sdk/storage/Azure.Storage.Files.DataLake/src/autorest.md
Run dotnet build /t:GenerateCode to generate code.
input-file:
- https://raw.githubusercontent.com/Azure/azure-rest-api-specs/be46becafeb29aa993898709e35759d3643b2809/specification/storage/data-plane/Azure.Storage.Files.DataLake/stable/2026-02-06/DataLakeStorage.json
generation1-convenience-client: true
modelerfour:
seal-single-value-enum-by-default: true
helper-namespace: Azure.Storage.Common
directive:
- from: swagger-document
where: $["x-ms-paths"]
transform: >
for (const property in $)
{
if (property.includes('/{filesystem}/{path}'))
{
$[property]["parameters"] = $[property]["parameters"].filter(function(param) { return (typeof param['$ref'] === "undefined") || (false == param['$ref'].endsWith("#/parameters/FileSystem") && false == param['$ref'].endsWith("#/parameters/Path"))});
}
else if (property.includes('/{filesystem}'))
{
$[property]["parameters"] = $[property]["parameters"].filter(function(param) { return (typeof param['$ref'] === "undefined") || (false == param['$ref'].endsWith("#/parameters/FileSystem"))});
}
}
directive:
- from: swagger-document
where: $.parameters
transform: >
$.Path["x-ms-skip-url-encoding"] = true;
directive:
- from: swagger-document
where: $.parameters
transform: >
delete $.CacheControl["x-ms-parameter-grouping"];
delete $.ContentDisposition["x-ms-parameter-grouping"];
delete $.ContentEncoding["x-ms-parameter-grouping"];
delete $.ContentLanguage["x-ms-parameter-grouping"];
delete $.ContentType["x-ms-parameter-grouping"];
delete $.TransactionalContentMD5["x-ms-parameter-grouping"];
delete $.ContentMD5["x-ms-parameter-grouping"];
delete $.LeaseIdOptional["x-ms-parameter-grouping"];
delete $.IfMatch["x-ms-parameter-grouping"];
delete $.IfModifiedSince["x-ms-parameter-grouping"];
delete $.IfNoneMatch["x-ms-parameter-grouping"];
delete $.IfUnmodifiedSince["x-ms-parameter-grouping"];
delete $.SourceIfMatch["x-ms-parameter-grouping"];
delete $.SourceIfModifiedSince["x-ms-parameter-grouping"];
delete $.SourceIfNoneMatch["x-ms-parameter-grouping"];
delete $.SourceIfUnmodifiedSince["x-ms-parameter-grouping"];
delete $.SourceLeaseId["x-ms-parameter-grouping"];
delete $.EncryptionKey["x-ms-parameter-grouping"];
delete $.EncryptionKeySha256["x-ms-parameter-grouping"];
delete $.EncryptionAlgorithm["x-ms-parameter-grouping"];
directive:
- from: swagger-document
where: $.definitions
transform: >
$.Path.properties.lastModified.format = "date-time-rfc1123";
delete $.Path.properties.contentLength;
$.Path.properties.contentLength = {
"type": "string"
};
delete $.Path.properties.isDirectory;
$.Path.properties.isDirectory = {
"type": "string"
};
delete $.Path.properties.eTag;
$.Path.properties.etag = {
"type": "string"
};
directive:
- from: swagger-document
where: $["x-ms-paths"]["/{filesystem}/{path}?action=append"]
transform: >
$.patch.consumes = [
"application/octet-stream"
]
directive:
- from: swagger-document
where: $..[?(@.operationId=='Path_Read')]
transform: $["x-csharp-buffer-response"] = false;
directive:
- from: swagger-document
where: $["x-ms-paths"]
transform: >
for (const property in $)
{
if (property.includes('/{filesystem}/{path}'))
{
var oldName = property;
var newName = property.replace('/{filesystem}/{path}', '');
if (!newName.includes('?'))
{
newName = newName + '?' + 'filesystem_path'
}
$[newName] = $[oldName];
delete $[oldName];
}
else if (property.includes('/{filesystem}'))
{
var oldName = property;
var newName = property.replace('/{filesystem}', '');
if (!newName.includes('?'))
{
newName = newName + '?' + 'filesystem'
}
$[newName] = $[oldName];
delete $[oldName];
}
}
directive:
- from: swagger-document
where: $.parameters
transform: >
delete $.EncryptionAlgorithm.enum;
$.EncryptionAlgorithm.enum = [
"None",
"AES256"
];
directive:
- from: swagger-document
where: $.parameters
transform: >
delete $.LeaseAction["x-ms-enum"];
$.LeaseAction["x-ms-enum"] = {
"name": "DataLakeLeaseAction",
"modelAsString": false
};