/
StorageAccountPatch.cs
198 lines (190 loc) · 16.1 KB
/
StorageAccountPatch.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// <auto-generated/>
#nullable disable
using System;
using System.Collections.Generic;
using Azure.ResourceManager.Models;
namespace Azure.ResourceManager.Storage.Models
{
/// <summary> The parameters that can be provided when updating the storage account properties. </summary>
public partial class StorageAccountPatch
{
/// <summary>
/// Keeps track of any properties unknown to the library.
/// <para>
/// To assign an object to the value of this property use <see cref="BinaryData.FromObjectAsJson{T}(T, System.Text.Json.JsonSerializerOptions?)"/>.
/// </para>
/// <para>
/// To assign an already formatted json string to this property use <see cref="BinaryData.FromString(string)"/>.
/// </para>
/// <para>
/// Examples:
/// <list type="bullet">
/// <item>
/// <term>BinaryData.FromObjectAsJson("foo")</term>
/// <description>Creates a payload of "foo".</description>
/// </item>
/// <item>
/// <term>BinaryData.FromString("\"foo\"")</term>
/// <description>Creates a payload of "foo".</description>
/// </item>
/// <item>
/// <term>BinaryData.FromObjectAsJson(new { key = "value" })</term>
/// <description>Creates a payload of { "key": "value" }.</description>
/// </item>
/// <item>
/// <term>BinaryData.FromString("{\"key\": \"value\"}")</term>
/// <description>Creates a payload of { "key": "value" }.</description>
/// </item>
/// </list>
/// </para>
/// </summary>
private IDictionary<string, BinaryData> _serializedAdditionalRawData;
/// <summary> Initializes a new instance of <see cref="StorageAccountPatch"/>. </summary>
public StorageAccountPatch()
{
Tags = new ChangeTrackingDictionary<string, string>();
}
/// <summary> Initializes a new instance of <see cref="StorageAccountPatch"/>. </summary>
/// <param name="sku"> Gets or sets the SKU name. Note that the SKU name cannot be updated to Standard_ZRS, Premium_LRS or Premium_ZRS, nor can accounts of those SKU names be updated to any other value. </param>
/// <param name="tags"> Gets or sets a list of key value pairs that describe the resource. These tags can be used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can be provided for a resource. Each tag must have a key no greater in length than 128 characters and a value no greater in length than 256 characters. </param>
/// <param name="identity"> The identity of the resource. </param>
/// <param name="kind"> Optional. Indicates the type of storage account. Currently only StorageV2 value supported by server. </param>
/// <param name="customDomain"> Custom domain assigned to the storage account by the user. Name is the CNAME source. Only one custom domain is supported per storage account at this time. To clear the existing custom domain, use an empty string for the custom domain name property. </param>
/// <param name="encryption"> Not applicable. Azure Storage encryption at rest is enabled by default for all storage accounts and cannot be disabled. </param>
/// <param name="sasPolicy"> SasPolicy assigned to the storage account. </param>
/// <param name="keyPolicy"> KeyPolicy assigned to the storage account. </param>
/// <param name="accessTier"> Required for storage accounts where kind = BlobStorage. The access tier is used for billing. The 'Premium' access tier is the default value for premium block blobs storage account type and it cannot be changed for the premium block blobs storage account type. </param>
/// <param name="azureFilesIdentityBasedAuthentication"> Provides the identity based authentication settings for Azure Files. </param>
/// <param name="enableHttpsTrafficOnly"> Allows https traffic only to storage service if sets to true. </param>
/// <param name="isSftpEnabled"> Enables Secure File Transfer Protocol, if set to true. </param>
/// <param name="isLocalUserEnabled"> Enables local users feature, if set to true. </param>
/// <param name="networkRuleSet"> Network rule set. </param>
/// <param name="largeFileSharesState"> Allow large file shares if sets to Enabled. It cannot be disabled once it is enabled. </param>
/// <param name="routingPreference"> Maintains information about the network routing choice opted by the user for data transfer. </param>
/// <param name="allowBlobPublicAccess"> Allow or disallow public access to all blobs or containers in the storage account. The default interpretation is true for this property. </param>
/// <param name="minimumTlsVersion"> Set the minimum TLS version to be permitted on requests to storage. The default interpretation is TLS 1.0 for this property. </param>
/// <param name="allowSharedKeyAccess"> Indicates whether the storage account permits requests to be authorized with the account access key via Shared Key. If false, then all requests, including shared access signatures, must be authorized with Azure Active Directory (Azure AD). The default value is null, which is equivalent to true. </param>
/// <param name="allowCrossTenantReplication"> Allow or disallow cross AAD tenant object replication. The default interpretation is true for this property. </param>
/// <param name="isDefaultToOAuthAuthentication"> A boolean flag which indicates whether the default authentication is OAuth or not. The default interpretation is false for this property. </param>
/// <param name="publicNetworkAccess"> Allow or disallow public network access to Storage Account. Value is optional but if passed in, must be 'Enabled' or 'Disabled'. </param>
/// <param name="immutableStorageWithVersioning"> The property is immutable and can only be set to true at the account creation time. When set to true, it enables object level immutability for all the containers in the account by default. </param>
/// <param name="allowedCopyScope"> Restrict copy to and from Storage Accounts within an AAD tenant or with Private Links to the same VNet. </param>
/// <param name="dnsEndpointType"> Allows you to specify the type of endpoint. Set this to AzureDNSZone to create a large number of accounts in a single subscription, which creates accounts in an Azure DNS Zone and the endpoint URL will have an alphanumeric DNS Zone identifier. </param>
/// <param name="serializedAdditionalRawData"> Keeps track of any properties unknown to the library. </param>
internal StorageAccountPatch(StorageSku sku, IDictionary<string, string> tags, ManagedServiceIdentity identity, StorageKind? kind, StorageCustomDomain customDomain, StorageAccountEncryption encryption, StorageAccountSasPolicy sasPolicy, StorageAccountKeyPolicy keyPolicy, StorageAccountAccessTier? accessTier, FilesIdentityBasedAuthentication azureFilesIdentityBasedAuthentication, bool? enableHttpsTrafficOnly, bool? isSftpEnabled, bool? isLocalUserEnabled, StorageAccountNetworkRuleSet networkRuleSet, LargeFileSharesState? largeFileSharesState, StorageRoutingPreference routingPreference, bool? allowBlobPublicAccess, StorageMinimumTlsVersion? minimumTlsVersion, bool? allowSharedKeyAccess, bool? allowCrossTenantReplication, bool? isDefaultToOAuthAuthentication, StoragePublicNetworkAccess? publicNetworkAccess, ImmutableStorageAccount immutableStorageWithVersioning, AllowedCopyScope? allowedCopyScope, StorageDnsEndpointType? dnsEndpointType, IDictionary<string, BinaryData> serializedAdditionalRawData)
{
Sku = sku;
Tags = tags;
Identity = identity;
Kind = kind;
CustomDomain = customDomain;
Encryption = encryption;
SasPolicy = sasPolicy;
KeyPolicy = keyPolicy;
AccessTier = accessTier;
AzureFilesIdentityBasedAuthentication = azureFilesIdentityBasedAuthentication;
EnableHttpsTrafficOnly = enableHttpsTrafficOnly;
IsSftpEnabled = isSftpEnabled;
IsLocalUserEnabled = isLocalUserEnabled;
NetworkRuleSet = networkRuleSet;
LargeFileSharesState = largeFileSharesState;
RoutingPreference = routingPreference;
AllowBlobPublicAccess = allowBlobPublicAccess;
MinimumTlsVersion = minimumTlsVersion;
AllowSharedKeyAccess = allowSharedKeyAccess;
AllowCrossTenantReplication = allowCrossTenantReplication;
IsDefaultToOAuthAuthentication = isDefaultToOAuthAuthentication;
PublicNetworkAccess = publicNetworkAccess;
ImmutableStorageWithVersioning = immutableStorageWithVersioning;
AllowedCopyScope = allowedCopyScope;
DnsEndpointType = dnsEndpointType;
_serializedAdditionalRawData = serializedAdditionalRawData;
}
/// <summary> Gets or sets the SKU name. Note that the SKU name cannot be updated to Standard_ZRS, Premium_LRS or Premium_ZRS, nor can accounts of those SKU names be updated to any other value. </summary>
[WirePath("sku")]
public StorageSku Sku { get; set; }
/// <summary> Gets or sets a list of key value pairs that describe the resource. These tags can be used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can be provided for a resource. Each tag must have a key no greater in length than 128 characters and a value no greater in length than 256 characters. </summary>
[WirePath("tags")]
public IDictionary<string, string> Tags { get; }
/// <summary> The identity of the resource. </summary>
[WirePath("identity")]
public ManagedServiceIdentity Identity { get; set; }
/// <summary> Optional. Indicates the type of storage account. Currently only StorageV2 value supported by server. </summary>
[WirePath("kind")]
public StorageKind? Kind { get; set; }
/// <summary> Custom domain assigned to the storage account by the user. Name is the CNAME source. Only one custom domain is supported per storage account at this time. To clear the existing custom domain, use an empty string for the custom domain name property. </summary>
[WirePath("properties.customDomain")]
public StorageCustomDomain CustomDomain { get; set; }
/// <summary> Not applicable. Azure Storage encryption at rest is enabled by default for all storage accounts and cannot be disabled. </summary>
[WirePath("properties.encryption")]
public StorageAccountEncryption Encryption { get; set; }
/// <summary> SasPolicy assigned to the storage account. </summary>
[WirePath("properties.sasPolicy")]
public StorageAccountSasPolicy SasPolicy { get; set; }
/// <summary> KeyPolicy assigned to the storage account. </summary>
internal StorageAccountKeyPolicy KeyPolicy { get; set; }
/// <summary> The key expiration period in days. </summary>
[WirePath("properties.keyPolicy.keyExpirationPeriodInDays")]
public int? KeyExpirationPeriodInDays
{
get => KeyPolicy is null ? default(int?) : KeyPolicy.KeyExpirationPeriodInDays;
set
{
KeyPolicy = value.HasValue ? new StorageAccountKeyPolicy(value.Value) : null;
}
}
/// <summary> Required for storage accounts where kind = BlobStorage. The access tier is used for billing. The 'Premium' access tier is the default value for premium block blobs storage account type and it cannot be changed for the premium block blobs storage account type. </summary>
[WirePath("properties.accessTier")]
public StorageAccountAccessTier? AccessTier { get; set; }
/// <summary> Provides the identity based authentication settings for Azure Files. </summary>
[WirePath("properties.azureFilesIdentityBasedAuthentication")]
public FilesIdentityBasedAuthentication AzureFilesIdentityBasedAuthentication { get; set; }
/// <summary> Allows https traffic only to storage service if sets to true. </summary>
[WirePath("properties.supportsHttpsTrafficOnly")]
public bool? EnableHttpsTrafficOnly { get; set; }
/// <summary> Enables Secure File Transfer Protocol, if set to true. </summary>
[WirePath("properties.isSftpEnabled")]
public bool? IsSftpEnabled { get; set; }
/// <summary> Enables local users feature, if set to true. </summary>
[WirePath("properties.isLocalUserEnabled")]
public bool? IsLocalUserEnabled { get; set; }
/// <summary> Network rule set. </summary>
[WirePath("properties.networkAcls")]
public StorageAccountNetworkRuleSet NetworkRuleSet { get; set; }
/// <summary> Allow large file shares if sets to Enabled. It cannot be disabled once it is enabled. </summary>
[WirePath("properties.largeFileSharesState")]
public LargeFileSharesState? LargeFileSharesState { get; set; }
/// <summary> Maintains information about the network routing choice opted by the user for data transfer. </summary>
[WirePath("properties.routingPreference")]
public StorageRoutingPreference RoutingPreference { get; set; }
/// <summary> Allow or disallow public access to all blobs or containers in the storage account. The default interpretation is true for this property. </summary>
[WirePath("properties.allowBlobPublicAccess")]
public bool? AllowBlobPublicAccess { get; set; }
/// <summary> Set the minimum TLS version to be permitted on requests to storage. The default interpretation is TLS 1.0 for this property. </summary>
[WirePath("properties.minimumTlsVersion")]
public StorageMinimumTlsVersion? MinimumTlsVersion { get; set; }
/// <summary> Indicates whether the storage account permits requests to be authorized with the account access key via Shared Key. If false, then all requests, including shared access signatures, must be authorized with Azure Active Directory (Azure AD). The default value is null, which is equivalent to true. </summary>
[WirePath("properties.allowSharedKeyAccess")]
public bool? AllowSharedKeyAccess { get; set; }
/// <summary> Allow or disallow cross AAD tenant object replication. The default interpretation is true for this property. </summary>
[WirePath("properties.allowCrossTenantReplication")]
public bool? AllowCrossTenantReplication { get; set; }
/// <summary> A boolean flag which indicates whether the default authentication is OAuth or not. The default interpretation is false for this property. </summary>
[WirePath("properties.defaultToOAuthAuthentication")]
public bool? IsDefaultToOAuthAuthentication { get; set; }
/// <summary> Allow or disallow public network access to Storage Account. Value is optional but if passed in, must be 'Enabled' or 'Disabled'. </summary>
[WirePath("properties.publicNetworkAccess")]
public StoragePublicNetworkAccess? PublicNetworkAccess { get; set; }
/// <summary> The property is immutable and can only be set to true at the account creation time. When set to true, it enables object level immutability for all the containers in the account by default. </summary>
[WirePath("properties.immutableStorageWithVersioning")]
public ImmutableStorageAccount ImmutableStorageWithVersioning { get; set; }
/// <summary> Restrict copy to and from Storage Accounts within an AAD tenant or with Private Links to the same VNet. </summary>
[WirePath("properties.allowedCopyScope")]
public AllowedCopyScope? AllowedCopyScope { get; set; }
/// <summary> Allows you to specify the type of endpoint. Set this to AzureDNSZone to create a large number of accounts in a single subscription, which creates accounts in an Azure DNS Zone and the endpoint URL will have an alphanumeric DNS Zone identifier. </summary>
[WirePath("properties.dnsEndpointType")]
public StorageDnsEndpointType? DnsEndpointType { get; set; }
}
}