diff --git a/sdk/storage/Azure.Storage.Blobs/src/Generated/BlobRestClient.cs b/sdk/storage/Azure.Storage.Blobs/src/Generated/BlobRestClient.cs
index 40c0a6926f528..5b1894c6b59e7 100644
--- a/sdk/storage/Azure.Storage.Blobs/src/Generated/BlobRestClient.cs
+++ b/sdk/storage/Azure.Storage.Blobs/src/Generated/BlobRestClient.cs
@@ -19186,9 +19186,9 @@ public partial class BlobServiceProperties
///
/// The set of CORS rules.
///
-#pragma warning disable CA2227 // Collection properties should be readonly
+ #pragma warning disable CA2227 // Collection properties should be readonly
public System.Collections.Generic.IList Cors { get; set; }
-#pragma warning restore CA2227 // Collection properties should be readonly
+ #pragma warning restore CA2227 // Collection properties should be readonly
///
/// The default version to use for requests to the Blob service if an incoming request's version is not specified. Possible values include version 2008-10-27 and all more recent versions
diff --git a/sdk/storage/Azure.Storage.Common/swagger/Generator/src/generator.ts b/sdk/storage/Azure.Storage.Common/swagger/Generator/src/generator.ts
index fd3dae289306a..257bcf1de0263 100644
--- a/sdk/storage/Azure.Storage.Common/swagger/Generator/src/generator.ts
+++ b/sdk/storage/Azure.Storage.Common/swagger/Generator/src/generator.ts
@@ -902,12 +902,17 @@ function generateObject(w: IndentWriter, model: IServiceModel, type: IObjectType
w.line(`/// `);
w.line(`/// ${property.description || property.model.description || property.name}`);
w.line(`/// `);
+ let internalSetter = !property.isNullable && (property.readonly || property.model.type === `array`);
+ let isCollection = isPrimitiveType(property.model) && property.model.itemType && !type.struct;
if (property.model.type === `byte`) {
w.line(`#pragma warning disable CA1819 // Properties should not return arrays`);
}
+ if (isCollection && !internalSetter) {
+ w.line(`#pragma warning disable CA2227 // Collection properties should be readonly`);
+ }
w.write(`public ${types.getDeclarationType(property.model, property.required, property.readonly)} ${naming.property(property.clientName)} { get; `);
if (!type.struct) {
- if (!property.isNullable && (property.readonly || property.model.type === `array`)) {
+ if (internalSetter) {
w.write(`internal `);
}
w.write(`set; `);
@@ -917,6 +922,9 @@ function generateObject(w: IndentWriter, model: IServiceModel, type: IObjectType
if (property.model.type === `byte`) {
w.line(`#pragma warning restore CA1819 // Properties should not return arrays`);
}
+ if (isCollection && !internalSetter) {
+ w.line(`#pragma warning restore CA2227 // Collection properties should be readonly`);
+ }
}
// Instantiate nested models if necessary
diff --git a/sdk/storage/Azure.Storage.Files.Shares/src/Generated/FileRestClient.cs b/sdk/storage/Azure.Storage.Files.Shares/src/Generated/FileRestClient.cs
index e78386c9e1096..6a433a843dad4 100644
--- a/sdk/storage/Azure.Storage.Files.Shares/src/Generated/FileRestClient.cs
+++ b/sdk/storage/Azure.Storage.Files.Shares/src/Generated/FileRestClient.cs
@@ -11683,9 +11683,9 @@ public partial class ShareServiceProperties
///
/// The set of CORS rules.
///
-#pragma warning disable CA2227 // Collection properties should be readonly
+ #pragma warning disable CA2227 // Collection properties should be readonly
public System.Collections.Generic.IList Cors { get; set; }
-#pragma warning restore CA2227 // Collection properties should be readonly
+ #pragma warning restore CA2227 // Collection properties should be readonly
///
/// Protocol settings
diff --git a/sdk/storage/Azure.Storage.Queues/src/Generated/QueueRestClient.cs b/sdk/storage/Azure.Storage.Queues/src/Generated/QueueRestClient.cs
index a5fec105ca746..338a8b3b88d8f 100644
--- a/sdk/storage/Azure.Storage.Queues/src/Generated/QueueRestClient.cs
+++ b/sdk/storage/Azure.Storage.Queues/src/Generated/QueueRestClient.cs
@@ -1851,7 +1851,7 @@ internal static Azure.Response ClearAsync_CreateResponse(
/// The URL of the service account, queue or message that is the targe of the desired operation.
/// A Message object which can be stored in a Queue
/// Specifies the version of the operation to use for this request.
- /// Optional. Specifies the new visibility timeout value, in seconds, relative to server time. The default value is 30 seconds. A specified value must be larger than or equal to 1 second, and cannot be larger than 7 days, or larger than 2 hours on REST protocol versions prior to version 2011-08-18. The visibility timeout of a message can be set to a value later than the expiry time.
+ /// Optional. If specified, the request must be made using an x-ms-version of 2011-08-18 or later. If not specified, the default value is 0. Specifies the new visibility timeout value, in seconds, relative to server time. The new value must be larger than or equal to 0, and cannot be larger than 7 days. The visibility timeout of a message cannot be set to a value later than the expiry time. visibilitytimeout should be set to a value smaller than the time-to-live value.
/// Optional. Specifies the time-to-live interval for the message, in seconds. Prior to version 2017-07-29, the maximum time-to-live allowed is 7 days. For version 2017-07-29 or later, the maximum time-to-live can be any positive number, as well as -1 indicating that the message does not expire. If this parameter is omitted, the default time-to-live is 7 days.
/// The The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for Queue Service Operations.
/// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled.
@@ -1922,7 +1922,7 @@ internal static Azure.Response ClearAsync_CreateResponse(
/// The URL of the service account, queue or message that is the targe of the desired operation.
/// A Message object which can be stored in a Queue
/// Specifies the version of the operation to use for this request.
- /// Optional. Specifies the new visibility timeout value, in seconds, relative to server time. The default value is 30 seconds. A specified value must be larger than or equal to 1 second, and cannot be larger than 7 days, or larger than 2 hours on REST protocol versions prior to version 2011-08-18. The visibility timeout of a message can be set to a value later than the expiry time.
+ /// Optional. If specified, the request must be made using an x-ms-version of 2011-08-18 or later. If not specified, the default value is 0. Specifies the new visibility timeout value, in seconds, relative to server time. The new value must be larger than or equal to 0, and cannot be larger than 7 days. The visibility timeout of a message cannot be set to a value later than the expiry time. visibilitytimeout should be set to a value smaller than the time-to-live value.
/// Optional. Specifies the time-to-live interval for the message, in seconds. Prior to version 2017-07-29, the maximum time-to-live allowed is 7 days. For version 2017-07-29 or later, the maximum time-to-live can be any positive number, as well as -1 indicating that the message does not expire. If this parameter is omitted, the default time-to-live is 7 days.
/// The The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for Queue Service Operations.
/// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled.
@@ -3968,9 +3968,9 @@ public partial class QueueServiceProperties
///
/// The set of CORS rules.
///
-#pragma warning disable CA2227 // Collection properties should be readonly
+ #pragma warning disable CA2227 // Collection properties should be readonly
public System.Collections.Generic.IList Cors { get; set; }
-#pragma warning restore CA2227 // Collection properties should be readonly
+ #pragma warning restore CA2227 // Collection properties should be readonly
///
/// Creates a new QueueServiceProperties instance