public PSStorageAccount(StorageModels.StorageAccount storageAccount) { this.ResourceGroupName = new ResourceIdentifier(storageAccount.Id).ResourceGroupName; this.StorageAccountName = storageAccount.Name; this.Id = storageAccount.Id; this.Location = storageAccount.Location; this.Sku = new PSSku(storageAccount.Sku); this.Encryption = storageAccount.Encryption; this.Kind = storageAccount.Kind; this.AccessTier = storageAccount.AccessTier; this.CreationTime = storageAccount.CreationTime; this.CustomDomain = storageAccount.CustomDomain is null ? null : new PSCustomDomain(storageAccount.CustomDomain); this.Identity = storageAccount.Identity; this.LastGeoFailoverTime = storageAccount.LastGeoFailoverTime; this.PrimaryEndpoints = storageAccount.PrimaryEndpoints; this.PrimaryLocation = storageAccount.PrimaryLocation; this.ProvisioningState = storageAccount.ProvisioningState; this.SecondaryEndpoints = storageAccount.SecondaryEndpoints; this.SecondaryLocation = storageAccount.SecondaryLocation; this.StatusOfPrimary = storageAccount.StatusOfPrimary; this.StatusOfSecondary = storageAccount.StatusOfSecondary; this.Tags = storageAccount.Tags; this.EnableHttpsTrafficOnly = storageAccount.EnableHttpsTrafficOnly; this.NetworkRuleSet = PSNetworkRuleSet.ParsePSNetworkRule(storageAccount.NetworkRuleSet); this.EnableHierarchicalNamespace = storageAccount.IsHnsEnabled; this.FailoverInProgress = storageAccount.FailoverInProgress; this.LargeFileSharesState = storageAccount.LargeFileSharesState; this.AzureFilesIdentityBasedAuth = storageAccount.AzureFilesIdentityBasedAuthentication is null ? null : new PSAzureFilesIdentityBasedAuthentication(storageAccount.AzureFilesIdentityBasedAuthentication); this.GeoReplicationStats = PSGeoReplicationStats.ParsePSGeoReplicationStats(storageAccount.GeoReplicationStats); }
//Parse GeoReplicationStats in SDK to wrapped property PSGeoReplicationStats public static PSGeoReplicationStats ParsePSGeoReplicationStats(GeoReplicationStats geoReplicationStats) { if (geoReplicationStats == null) { return(null); } PSGeoReplicationStats pSGeoReplicationStats = new PSGeoReplicationStats(); pSGeoReplicationStats.Status = geoReplicationStats.Status; pSGeoReplicationStats.LastSyncTime = geoReplicationStats.LastSyncTime; pSGeoReplicationStats.CanFailover = geoReplicationStats.CanFailover; return(pSGeoReplicationStats); }
public PSStorageAccount(StorageModels.StorageAccount storageAccount) { this.ResourceGroupName = new ResourceIdentifier(storageAccount.Id).ResourceGroupName; this.StorageAccountName = storageAccount.Name; this.Id = storageAccount.Id; this.Location = storageAccount.Location; this.Sku = new PSSku(storageAccount.Sku); this.Encryption = storageAccount.Encryption; this.Kind = storageAccount.Kind; this.AccessTier = storageAccount.AccessTier; this.CreationTime = storageAccount.CreationTime; this.CustomDomain = storageAccount.CustomDomain is null ? null : new PSCustomDomain(storageAccount.CustomDomain); this.Identity = storageAccount.Identity; this.LastGeoFailoverTime = storageAccount.LastGeoFailoverTime; this.PrimaryEndpoints = storageAccount.PrimaryEndpoints; this.PrimaryLocation = storageAccount.PrimaryLocation; this.ProvisioningState = storageAccount.ProvisioningState; this.SecondaryEndpoints = storageAccount.SecondaryEndpoints; this.SecondaryLocation = storageAccount.SecondaryLocation; this.StatusOfPrimary = storageAccount.StatusOfPrimary; this.StatusOfSecondary = storageAccount.StatusOfSecondary; this.Tags = storageAccount.Tags; this.EnableHttpsTrafficOnly = storageAccount.EnableHttpsTrafficOnly; this.NetworkRuleSet = PSNetworkRuleSet.ParsePSNetworkRule(storageAccount.NetworkRuleSet); this.EnableHierarchicalNamespace = storageAccount.IsHnsEnabled; this.FailoverInProgress = storageAccount.FailoverInProgress; this.LargeFileSharesState = storageAccount.LargeFileSharesState; this.AzureFilesIdentityBasedAuth = storageAccount.AzureFilesIdentityBasedAuthentication is null ? null : new PSAzureFilesIdentityBasedAuthentication(storageAccount.AzureFilesIdentityBasedAuthentication); this.GeoReplicationStats = PSGeoReplicationStats.ParsePSGeoReplicationStats(storageAccount.GeoReplicationStats); this.AllowBlobPublicAccess = storageAccount.AllowBlobPublicAccess; this.MinimumTlsVersion = storageAccount.MinimumTlsVersion; this.RoutingPreference = PSRoutingPreference.ParsePSRoutingPreference(storageAccount.RoutingPreference); this.BlobRestoreStatus = storageAccount.BlobRestoreStatus is null ? null : new PSBlobRestoreStatus(storageAccount.BlobRestoreStatus); this.EnableNfsV3 = storageAccount.EnableNfsV3; this.ExtendedLocation = storageAccount.ExtendedLocation is null ? null : new PSExtendedLocation(storageAccount.ExtendedLocation); this.AllowSharedKeyAccess = storageAccount.AllowSharedKeyAccess; this.KeyCreationTime = storageAccount.KeyCreationTime is null ? null : new PSKeyCreationTime(storageAccount.KeyCreationTime); this.KeyPolicy = storageAccount.KeyPolicy; this.SasPolicy = storageAccount.SasPolicy; this.AllowCrossTenantReplication = storageAccount.AllowCrossTenantReplication; this.PublicNetworkAccess = storageAccount.PublicNetworkAccess; this.ImmutableStorageWithVersioning = storageAccount.ImmutableStorageWithVersioning is null ? null : new PSImmutableStorageAccount(storageAccount.ImmutableStorageWithVersioning); this.StorageAccountSkuConversionStatus = storageAccount.StorageAccountSkuConversionStatus is null ? null : new PSStorageAccountSkuConversionStatus(storageAccount.StorageAccountSkuConversionStatus); }