Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
76 changes: 62 additions & 14 deletions sdk/storage/Azure.Storage.Blobs/src/Generated/BlobRestClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13176,29 +13176,79 @@ internal BlobBatchResult() { }
}
#endregion class BlobBatchResult

#region class BlobBlock
#region struct BlobBlock
namespace Azure.Storage.Blobs.Models
{
/// <summary>
/// Represents a single block in a block blob. It describes the block's ID and size.
/// </summary>
public partial class BlobBlock
public readonly partial struct BlobBlock: System.IEquatable<BlobBlock>
{
/// <summary>
/// The base64 encoded block ID.
/// </summary>
public string Name { get; internal set; }
public string Name { get; }

/// <summary>
/// The block size in bytes.
/// </summary>
public int Size { get; internal set; }
public int Size { get; }

/// <summary>
/// Prevent direct instantiation of BlobBlock instances.
/// You can use BlobsModelFactory.BlobBlock instead.
/// </summary>
internal BlobBlock() { }
internal BlobBlock(
string name,
int size)
{
Name = name;
Size = size;
}

/// <summary>
/// Check if two BlobBlock instances are equal.
/// </summary>
/// <param name="other">The instance to compare to.</param>
/// <returns>True if they're equal, false otherwise.</returns>
[System.ComponentModel.EditorBrowsable((System.ComponentModel.EditorBrowsableState.Never))]
public bool Equals(BlobBlock other)
{
if (!System.StringComparer.Ordinal.Equals(Name, other.Name))
{
return false;
}
if (!Size.Equals(other.Size))
{
return false;
}

return true;
}

/// <summary>
/// Check if two BlobBlock instances are equal.
/// </summary>
/// <param name="obj">The instance to compare to.</param>
/// <returns>True if they're equal, false otherwise.</returns>
[System.ComponentModel.EditorBrowsable((System.ComponentModel.EditorBrowsableState.Never))]
public override bool Equals(object obj) => obj is BlobBlock && Equals((BlobBlock)obj);

/// <summary>
/// Get a hash code for the BlobBlock.
/// </summary>
[System.ComponentModel.EditorBrowsable((System.ComponentModel.EditorBrowsableState.Never))]
public override int GetHashCode()
{
var hashCode = new Azure.Core.HashCodeBuilder();
if (Name != null)
{
hashCode.Add(Name, System.StringComparer.Ordinal);
}
hashCode.Add(Size);

return hashCode.ToHashCode();
}

/// <summary>
/// Deserializes XML into a new BlobBlock instance.
Expand All @@ -13209,17 +13259,19 @@ internal static Azure.Storage.Blobs.Models.BlobBlock FromXml(System.Xml.Linq.XEl
{
System.Diagnostics.Debug.Assert(element != null);
System.Xml.Linq.XElement _child;
Azure.Storage.Blobs.Models.BlobBlock _value = new Azure.Storage.Blobs.Models.BlobBlock();
string name = default;
int size = default;
_child = element.Element(System.Xml.Linq.XName.Get("Name", ""));
if (_child != null)
{
_value.Name = _child.Value;
name = _child.Value;
}
_child = element.Element(System.Xml.Linq.XName.Get("Size", ""));
if (_child != null)
{
_value.Size = int.Parse(_child.Value, System.Globalization.CultureInfo.InvariantCulture);
size = int.Parse(_child.Value, System.Globalization.CultureInfo.InvariantCulture);
}
Azure.Storage.Blobs.Models.BlobBlock _value = new Azure.Storage.Blobs.Models.BlobBlock(name, size);
CustomizeFromXml(element, _value);
return _value;
}
Expand All @@ -13239,15 +13291,11 @@ public static BlobBlock BlobBlock(
string name,
int size)
{
return new BlobBlock()
{
Name = name,
Size = size,
};
return new BlobBlock(name, size);
}
}
}
#endregion class BlobBlock
#endregion struct BlobBlock

#region class BlobContainerAccessPolicy
namespace Azure.Storage.Blobs.Models
Expand Down
2 changes: 2 additions & 0 deletions sdk/storage/Azure.Storage.Blobs/swagger/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -1305,6 +1305,7 @@ directive:
$.BlobBlock = $.Block;
delete $.Block;
$.BlobBlock.xml = { "name": "Block" };
$.BlobBlock["x-az-struct"] = true;
const path = $.BlockList.properties.CommittedBlocks.items.$ref.replace(/[#].*$/, "#/definitions/BlobBlock");
$.BlockList.properties.CommittedBlocks.items.$ref = path;
$.BlockList.properties.CommittedBlocks.xml.name = "CommittedBlocks";
Expand Down Expand Up @@ -1338,6 +1339,7 @@ directive:
$.PageList["x-az-public"] = false;
$.PageRange["x-az-public"] = false;
$.ClearRange["x-az-public"] = false;
```

### Access Policy properties renaming
``` yaml
Expand Down