internal BlobPrefix(BlobName name) { if (name == null) { throw new ArgumentNullException(nameof(name)); } Name = name; }
internal static BlobPrefix DeserializeBlobPrefix(XElement element) { BlobName name = default; if (element.Element("Name") is XElement nameElement) { name = BlobName.DeserializeBlobName(nameElement); } return(new BlobPrefix(name)); }
internal BlobItemInternal(BlobName name, bool deleted, string snapshot, string versionId, bool?isCurrentVersion, BlobPropertiesInternal properties, IReadOnlyDictionary <string, string> metadata, BlobTags blobTags, bool?hasVersionsOnly, IReadOnlyDictionary <string, string> orMetadata) { Name = name; Deleted = deleted; Snapshot = snapshot; VersionId = versionId; IsCurrentVersion = isCurrentVersion; Properties = properties; Metadata = metadata; BlobTags = blobTags; HasVersionsOnly = hasVersionsOnly; OrMetadata = orMetadata; }
internal BlobItemInternal(BlobName name, bool deleted, string snapshot, BlobPropertiesInternal properties) { if (name == null) { throw new ArgumentNullException(nameof(name)); } if (snapshot == null) { throw new ArgumentNullException(nameof(snapshot)); } if (properties == null) { throw new ArgumentNullException(nameof(properties)); } Name = name; Deleted = deleted; Snapshot = snapshot; Properties = properties; Metadata = new ChangeTrackingDictionary <string, string>(); OrMetadata = new ChangeTrackingDictionary <string, string>(); }
/// <summary> /// Get a hash code for the TaggedBlobItem. /// </summary> /// <returns>Hash code for the TaggedBlobItem.</returns> public override int GetHashCode() => BlobName.GetHashCode() ^ BlobContainerName.GetHashCode();
internal static BlobItemInternal DeserializeBlobItemInternal(XElement element) { BlobName name = default; bool deleted = default; string snapshot = default; string versionId = default; bool? isCurrentVersion = default; BlobPropertiesInternal properties = default; IReadOnlyDictionary <string, string> metadata = default; BlobTags blobTags = default; bool? hasVersionsOnly = default; IReadOnlyDictionary <string, string> orMetadata = default; if (element.Element("Name") is XElement nameElement) { name = BlobName.DeserializeBlobName(nameElement); } if (element.Element("Deleted") is XElement deletedElement) { deleted = (bool)deletedElement; } if (element.Element("Snapshot") is XElement snapshotElement) { snapshot = (string)snapshotElement; } if (element.Element("VersionId") is XElement versionIdElement) { versionId = (string)versionIdElement; } if (element.Element("IsCurrentVersion") is XElement isCurrentVersionElement) { isCurrentVersion = (bool?)isCurrentVersionElement; } if (element.Element("Properties") is XElement propertiesElement) { properties = BlobPropertiesInternal.DeserializeBlobPropertiesInternal(propertiesElement); } if (element.Element("Metadata") is XElement metadataElement) { var dictionary = new Dictionary <string, string>(); foreach (var e in metadataElement.Elements()) { dictionary.Add(e.Name.LocalName, (string)e); } metadata = dictionary; } if (element.Element("Tags") is XElement tagsElement) { blobTags = BlobTags.DeserializeBlobTags(tagsElement); } if (element.Element("HasVersionsOnly") is XElement hasVersionsOnlyElement) { hasVersionsOnly = (bool?)hasVersionsOnlyElement; } if (element.Element("OrMetadata") is XElement orMetadataElement) { var dictionary = new Dictionary <string, string>(); foreach (var e in orMetadataElement.Elements()) { dictionary.Add(e.Name.LocalName, (string)e); } orMetadata = dictionary; } return(new BlobItemInternal(name, deleted, snapshot, versionId, isCurrentVersion, properties, metadata, blobTags, hasVersionsOnly, orMetadata)); }