public PSStackEdgeShare(Share share) { this.Share = share ?? throw new ArgumentNullException("share"); this.Id = share.Id; if (share.AzureContainerInfo != null) { this.StorageAccountName = GetStorageAccountCredentialAccountName(share.AzureContainerInfo .StorageAccountCredentialId); } else { this.StorageAccountName = "N/A"; } var resourceIdentifier = new StackEdgeResourceIdentifier(share.Id); this.ResourceGroupName = resourceIdentifier.ResourceGroupName; this.DeviceName = resourceIdentifier.DeviceName; this.Name = resourceIdentifier.ResourceName; if (share.AccessProtocol.Equals("SMB") && share.UserAccessRights != null && share.UserAccessRights.Count > 0) { UserAccessRight = new List <Dictionary <string, string> >(); foreach (var userAccessRight in share.UserAccessRights) { var userIdentifier = new StackEdgeResourceIdentifier(userAccessRight.UserId); var username = userIdentifier.Name; var accessRight = new Dictionary <string, string>() { { "Username", username }, { "AccessRight", userAccessRight.AccessType } }; UserAccessRight.Add(accessRight); } } else if (share.ClientAccessRights != null && share.ClientAccessRights.Count > 0) { ClientAccessRight = new List <Dictionary <string, string> >(); foreach (var shareClientAccessRight in share.ClientAccessRights) { var accessRight = new Dictionary <string, string>() { { "ClientId", shareClientAccessRight.Client }, { "AccessRight", shareClientAccessRight.AccessPermission } }; ClientAccessRight.Add(accessRight); } } }
public PSStackEdgeShare() { Share = new Share(); }
public PSDataBoxEdgeShare() { Share = new Share(); }