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);
 }
Exemple #2
0
        //Parse RoutingPreference  in SDK to wrapped property PSRoutingPreference
        public static PSRoutingPreference ParsePSRoutingPreference(RoutingPreference routingPreference)
        {
            if (routingPreference == null)
            {
                return(null);
            }

            PSRoutingPreference pSRoutingPreference = new PSRoutingPreference();

            pSRoutingPreference.RoutingChoice             = routingPreference.RoutingChoice;
            pSRoutingPreference.PublishMicrosoftEndpoints = routingPreference.PublishMicrosoftEndpoints;
            pSRoutingPreference.PublishInternetEndpoints  = routingPreference.PublishInternetEndpoints;

            return(pSRoutingPreference);
        }