/
SqlDatabasePatch.cs
309 lines (302 loc) · 23.7 KB
/
SqlDatabasePatch.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
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// <auto-generated/>
#nullable disable
using System;
using System.Collections.Generic;
using Azure.Core;
namespace Azure.ResourceManager.Sql.Models
{
/// <summary> A database update resource. </summary>
public partial class SqlDatabasePatch
{
/// <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="SqlDatabasePatch"/>. </summary>
public SqlDatabasePatch()
{
Tags = new ChangeTrackingDictionary<string, string>();
}
/// <summary> Initializes a new instance of <see cref="SqlDatabasePatch"/>. </summary>
/// <param name="sku"> The name and tier of the SKU. </param>
/// <param name="identity"> Database identity. </param>
/// <param name="tags"> Resource tags. </param>
/// <param name="createMode">
/// Specifies the mode of database creation.
///
/// Default: regular database creation.
///
/// Copy: creates a database as a copy of an existing database. sourceDatabaseId must be specified as the resource ID of the source database.
///
/// Secondary: creates a database as a secondary replica of an existing database. sourceDatabaseId must be specified as the resource ID of the existing primary database.
///
/// PointInTimeRestore: Creates a database by restoring a point in time backup of an existing database. sourceDatabaseId must be specified as the resource ID of the existing database, and restorePointInTime must be specified.
///
/// Recovery: Creates a database by restoring a geo-replicated backup. sourceDatabaseId must be specified as the recoverable database resource ID to restore.
///
/// Restore: Creates a database by restoring a backup of a deleted database. sourceDatabaseId must be specified. If sourceDatabaseId is the database's original resource ID, then sourceDatabaseDeletionDate must be specified. Otherwise sourceDatabaseId must be the restorable dropped database resource ID and sourceDatabaseDeletionDate is ignored. restorePointInTime may also be specified to restore from an earlier point in time.
///
/// RestoreLongTermRetentionBackup: Creates a database by restoring from a long term retention vault. recoveryServicesRecoveryPointResourceId must be specified as the recovery point resource ID.
///
/// Copy, Secondary, and RestoreLongTermRetentionBackup are not supported for DataWarehouse edition.
/// </param>
/// <param name="collation"> The collation of the database. </param>
/// <param name="maxSizeBytes"> The max size of the database expressed in bytes. </param>
/// <param name="sampleName"> The name of the sample schema to apply when creating this database. </param>
/// <param name="elasticPoolId"> The resource identifier of the elastic pool containing this database. </param>
/// <param name="sourceDatabaseId"> The resource identifier of the source database associated with create operation of this database. </param>
/// <param name="status"> The status of the database. </param>
/// <param name="databaseId"> The ID of the database. </param>
/// <param name="createdOn"> The creation date of the database (ISO8601 format). </param>
/// <param name="currentServiceObjectiveName"> The current service level objective name of the database. </param>
/// <param name="requestedServiceObjectiveName"> The requested service level objective name of the database. </param>
/// <param name="defaultSecondaryLocation"> The default secondary region for this database. </param>
/// <param name="failoverGroupId"> Failover Group resource identifier that this database belongs to. </param>
/// <param name="restorePointInTime"> Specifies the point in time (ISO8601 format) of the source database that will be restored to create the new database. </param>
/// <param name="sourceDatabaseDeletedOn"> Specifies the time that the database was deleted. </param>
/// <param name="recoveryServicesRecoveryPointId"> The resource identifier of the recovery point associated with create operation of this database. </param>
/// <param name="longTermRetentionBackupResourceId"> The resource identifier of the long term retention backup associated with create operation of this database. </param>
/// <param name="recoverableDatabaseId"> The resource identifier of the recoverable database associated with create operation of this database. </param>
/// <param name="restorableDroppedDatabaseId"> The resource identifier of the restorable dropped database associated with create operation of this database. </param>
/// <param name="catalogCollation"> Collation of the metadata catalog. </param>
/// <param name="isZoneRedundant"> Whether or not this database is zone redundant, which means the replicas of this database will be spread across multiple availability zones. </param>
/// <param name="licenseType"> The license type to apply for this database. `LicenseIncluded` if you need a license, or `BasePrice` if you have a license and are eligible for the Azure Hybrid Benefit. </param>
/// <param name="maxLogSizeBytes"> The max log size for this database. </param>
/// <param name="earliestRestoreOn"> This records the earliest start date and time that restore is available for this database (ISO8601 format). </param>
/// <param name="readScale"> The state of read-only routing. If enabled, connections that have application intent set to readonly in their connection string may be routed to a readonly secondary replica in the same region. Not applicable to a Hyperscale database within an elastic pool. </param>
/// <param name="highAvailabilityReplicaCount"> The number of secondary replicas associated with the database that are used to provide high availability. Not applicable to a Hyperscale database within an elastic pool. </param>
/// <param name="secondaryType"> The secondary type of the database if it is a secondary. Valid values are Geo, Named and Standby. </param>
/// <param name="currentSku"> The name and tier of the SKU. </param>
/// <param name="autoPauseDelay"> Time in minutes after which database is automatically paused. A value of -1 means that automatic pause is disabled. </param>
/// <param name="currentBackupStorageRedundancy"> The storage account type used to store backups for this database. </param>
/// <param name="requestedBackupStorageRedundancy"> The storage account type to be used to store backups for this database. </param>
/// <param name="minCapacity"> Minimal capacity that database will always have allocated, if not paused. </param>
/// <param name="pausedOn"> The date when database was paused by user configuration or action(ISO8601 format). Null if the database is ready. </param>
/// <param name="resumedOn"> The date when database was resumed by user action or database login (ISO8601 format). Null if the database is paused. </param>
/// <param name="maintenanceConfigurationId"> Maintenance configuration id assigned to the database. This configuration defines the period when the maintenance updates will occur. </param>
/// <param name="isLedgerOn"> Whether or not this database is a ledger database, which means all tables in the database are ledger tables. Note: the value of this property cannot be changed after the database has been created. </param>
/// <param name="isInfraEncryptionEnabled"> Infra encryption is enabled for this database. </param>
/// <param name="federatedClientId"> The Client id used for cross tenant per database CMK scenario. </param>
/// <param name="preferredEnclaveType"> Type of enclave requested on the database i.e. Default or VBS enclaves. </param>
/// <param name="serializedAdditionalRawData"> Keeps track of any properties unknown to the library. </param>
internal SqlDatabasePatch(SqlSku sku, DatabaseIdentity identity, IDictionary<string, string> tags, SqlDatabaseCreateMode? createMode, string collation, long? maxSizeBytes, SampleSchemaName? sampleName, ResourceIdentifier elasticPoolId, ResourceIdentifier sourceDatabaseId, SqlDatabaseStatus? status, Guid? databaseId, DateTimeOffset? createdOn, string currentServiceObjectiveName, string requestedServiceObjectiveName, AzureLocation? defaultSecondaryLocation, ResourceIdentifier failoverGroupId, DateTimeOffset? restorePointInTime, DateTimeOffset? sourceDatabaseDeletedOn, ResourceIdentifier recoveryServicesRecoveryPointId, ResourceIdentifier longTermRetentionBackupResourceId, ResourceIdentifier recoverableDatabaseId, ResourceIdentifier restorableDroppedDatabaseId, CatalogCollationType? catalogCollation, bool? isZoneRedundant, DatabaseLicenseType? licenseType, long? maxLogSizeBytes, DateTimeOffset? earliestRestoreOn, DatabaseReadScale? readScale, int? highAvailabilityReplicaCount, SecondaryType? secondaryType, SqlSku currentSku, int? autoPauseDelay, SqlBackupStorageRedundancy? currentBackupStorageRedundancy, SqlBackupStorageRedundancy? requestedBackupStorageRedundancy, double? minCapacity, DateTimeOffset? pausedOn, DateTimeOffset? resumedOn, ResourceIdentifier maintenanceConfigurationId, bool? isLedgerOn, bool? isInfraEncryptionEnabled, Guid? federatedClientId, SqlAlwaysEncryptedEnclaveType? preferredEnclaveType, IDictionary<string, BinaryData> serializedAdditionalRawData)
{
Sku = sku;
Identity = identity;
Tags = tags;
CreateMode = createMode;
Collation = collation;
MaxSizeBytes = maxSizeBytes;
SampleName = sampleName;
ElasticPoolId = elasticPoolId;
SourceDatabaseId = sourceDatabaseId;
Status = status;
DatabaseId = databaseId;
CreatedOn = createdOn;
CurrentServiceObjectiveName = currentServiceObjectiveName;
RequestedServiceObjectiveName = requestedServiceObjectiveName;
DefaultSecondaryLocation = defaultSecondaryLocation;
FailoverGroupId = failoverGroupId;
RestorePointInTime = restorePointInTime;
SourceDatabaseDeletedOn = sourceDatabaseDeletedOn;
RecoveryServicesRecoveryPointId = recoveryServicesRecoveryPointId;
LongTermRetentionBackupResourceId = longTermRetentionBackupResourceId;
RecoverableDatabaseId = recoverableDatabaseId;
RestorableDroppedDatabaseId = restorableDroppedDatabaseId;
CatalogCollation = catalogCollation;
IsZoneRedundant = isZoneRedundant;
LicenseType = licenseType;
MaxLogSizeBytes = maxLogSizeBytes;
EarliestRestoreOn = earliestRestoreOn;
ReadScale = readScale;
HighAvailabilityReplicaCount = highAvailabilityReplicaCount;
SecondaryType = secondaryType;
CurrentSku = currentSku;
AutoPauseDelay = autoPauseDelay;
CurrentBackupStorageRedundancy = currentBackupStorageRedundancy;
RequestedBackupStorageRedundancy = requestedBackupStorageRedundancy;
MinCapacity = minCapacity;
PausedOn = pausedOn;
ResumedOn = resumedOn;
MaintenanceConfigurationId = maintenanceConfigurationId;
IsLedgerOn = isLedgerOn;
IsInfraEncryptionEnabled = isInfraEncryptionEnabled;
FederatedClientId = federatedClientId;
PreferredEnclaveType = preferredEnclaveType;
_serializedAdditionalRawData = serializedAdditionalRawData;
}
/// <summary> The name and tier of the SKU. </summary>
[WirePath("sku")]
public SqlSku Sku { get; set; }
/// <summary> Database identity. </summary>
[WirePath("identity")]
public DatabaseIdentity Identity { get; set; }
/// <summary> Resource tags. </summary>
[WirePath("tags")]
public IDictionary<string, string> Tags { get; }
/// <summary>
/// Specifies the mode of database creation.
///
/// Default: regular database creation.
///
/// Copy: creates a database as a copy of an existing database. sourceDatabaseId must be specified as the resource ID of the source database.
///
/// Secondary: creates a database as a secondary replica of an existing database. sourceDatabaseId must be specified as the resource ID of the existing primary database.
///
/// PointInTimeRestore: Creates a database by restoring a point in time backup of an existing database. sourceDatabaseId must be specified as the resource ID of the existing database, and restorePointInTime must be specified.
///
/// Recovery: Creates a database by restoring a geo-replicated backup. sourceDatabaseId must be specified as the recoverable database resource ID to restore.
///
/// Restore: Creates a database by restoring a backup of a deleted database. sourceDatabaseId must be specified. If sourceDatabaseId is the database's original resource ID, then sourceDatabaseDeletionDate must be specified. Otherwise sourceDatabaseId must be the restorable dropped database resource ID and sourceDatabaseDeletionDate is ignored. restorePointInTime may also be specified to restore from an earlier point in time.
///
/// RestoreLongTermRetentionBackup: Creates a database by restoring from a long term retention vault. recoveryServicesRecoveryPointResourceId must be specified as the recovery point resource ID.
///
/// Copy, Secondary, and RestoreLongTermRetentionBackup are not supported for DataWarehouse edition.
/// </summary>
[WirePath("properties.createMode")]
public SqlDatabaseCreateMode? CreateMode { get; set; }
/// <summary> The collation of the database. </summary>
[WirePath("properties.collation")]
public string Collation { get; set; }
/// <summary> The max size of the database expressed in bytes. </summary>
[WirePath("properties.maxSizeBytes")]
public long? MaxSizeBytes { get; set; }
/// <summary> The name of the sample schema to apply when creating this database. </summary>
[WirePath("properties.sampleName")]
public SampleSchemaName? SampleName { get; set; }
/// <summary> The resource identifier of the elastic pool containing this database. </summary>
[WirePath("properties.elasticPoolId")]
public ResourceIdentifier ElasticPoolId { get; set; }
/// <summary> The resource identifier of the source database associated with create operation of this database. </summary>
[WirePath("properties.sourceDatabaseId")]
public ResourceIdentifier SourceDatabaseId { get; set; }
/// <summary> The status of the database. </summary>
[WirePath("properties.status")]
public SqlDatabaseStatus? Status { get; }
/// <summary> The ID of the database. </summary>
[WirePath("properties.databaseId")]
public Guid? DatabaseId { get; }
/// <summary> The creation date of the database (ISO8601 format). </summary>
[WirePath("properties.creationDate")]
public DateTimeOffset? CreatedOn { get; }
/// <summary> The current service level objective name of the database. </summary>
[WirePath("properties.currentServiceObjectiveName")]
public string CurrentServiceObjectiveName { get; }
/// <summary> The requested service level objective name of the database. </summary>
[WirePath("properties.requestedServiceObjectiveName")]
public string RequestedServiceObjectiveName { get; }
/// <summary> The default secondary region for this database. </summary>
[WirePath("properties.defaultSecondaryLocation")]
public AzureLocation? DefaultSecondaryLocation { get; }
/// <summary> Failover Group resource identifier that this database belongs to. </summary>
[WirePath("properties.failoverGroupId")]
public ResourceIdentifier FailoverGroupId { get; }
/// <summary> Specifies the point in time (ISO8601 format) of the source database that will be restored to create the new database. </summary>
[WirePath("properties.restorePointInTime")]
public DateTimeOffset? RestorePointInTime { get; set; }
/// <summary> Specifies the time that the database was deleted. </summary>
[WirePath("properties.sourceDatabaseDeletionDate")]
public DateTimeOffset? SourceDatabaseDeletedOn { get; set; }
/// <summary> The resource identifier of the recovery point associated with create operation of this database. </summary>
[WirePath("properties.recoveryServicesRecoveryPointId")]
public ResourceIdentifier RecoveryServicesRecoveryPointId { get; set; }
/// <summary> The resource identifier of the long term retention backup associated with create operation of this database. </summary>
[WirePath("properties.longTermRetentionBackupResourceId")]
public ResourceIdentifier LongTermRetentionBackupResourceId { get; set; }
/// <summary> The resource identifier of the recoverable database associated with create operation of this database. </summary>
[WirePath("properties.recoverableDatabaseId")]
public ResourceIdentifier RecoverableDatabaseId { get; set; }
/// <summary> The resource identifier of the restorable dropped database associated with create operation of this database. </summary>
[WirePath("properties.restorableDroppedDatabaseId")]
public ResourceIdentifier RestorableDroppedDatabaseId { get; set; }
/// <summary> Collation of the metadata catalog. </summary>
[WirePath("properties.catalogCollation")]
public CatalogCollationType? CatalogCollation { get; set; }
/// <summary> Whether or not this database is zone redundant, which means the replicas of this database will be spread across multiple availability zones. </summary>
[WirePath("properties.zoneRedundant")]
public bool? IsZoneRedundant { get; set; }
/// <summary> The license type to apply for this database. `LicenseIncluded` if you need a license, or `BasePrice` if you have a license and are eligible for the Azure Hybrid Benefit. </summary>
[WirePath("properties.licenseType")]
public DatabaseLicenseType? LicenseType { get; set; }
/// <summary> The max log size for this database. </summary>
[WirePath("properties.maxLogSizeBytes")]
public long? MaxLogSizeBytes { get; }
/// <summary> This records the earliest start date and time that restore is available for this database (ISO8601 format). </summary>
[WirePath("properties.earliestRestoreDate")]
public DateTimeOffset? EarliestRestoreOn { get; }
/// <summary> The state of read-only routing. If enabled, connections that have application intent set to readonly in their connection string may be routed to a readonly secondary replica in the same region. Not applicable to a Hyperscale database within an elastic pool. </summary>
[WirePath("properties.readScale")]
public DatabaseReadScale? ReadScale { get; set; }
/// <summary> The number of secondary replicas associated with the database that are used to provide high availability. Not applicable to a Hyperscale database within an elastic pool. </summary>
[WirePath("properties.highAvailabilityReplicaCount")]
public int? HighAvailabilityReplicaCount { get; set; }
/// <summary> The secondary type of the database if it is a secondary. Valid values are Geo, Named and Standby. </summary>
[WirePath("properties.secondaryType")]
public SecondaryType? SecondaryType { get; set; }
/// <summary> The name and tier of the SKU. </summary>
[WirePath("properties.currentSku")]
public SqlSku CurrentSku { get; }
/// <summary> Time in minutes after which database is automatically paused. A value of -1 means that automatic pause is disabled. </summary>
[WirePath("properties.autoPauseDelay")]
public int? AutoPauseDelay { get; set; }
/// <summary> The storage account type used to store backups for this database. </summary>
[WirePath("properties.currentBackupStorageRedundancy")]
public SqlBackupStorageRedundancy? CurrentBackupStorageRedundancy { get; }
/// <summary> The storage account type to be used to store backups for this database. </summary>
[WirePath("properties.requestedBackupStorageRedundancy")]
public SqlBackupStorageRedundancy? RequestedBackupStorageRedundancy { get; set; }
/// <summary> Minimal capacity that database will always have allocated, if not paused. </summary>
[WirePath("properties.minCapacity")]
public double? MinCapacity { get; set; }
/// <summary> The date when database was paused by user configuration or action(ISO8601 format). Null if the database is ready. </summary>
[WirePath("properties.pausedDate")]
public DateTimeOffset? PausedOn { get; }
/// <summary> The date when database was resumed by user action or database login (ISO8601 format). Null if the database is paused. </summary>
[WirePath("properties.resumedDate")]
public DateTimeOffset? ResumedOn { get; }
/// <summary> Maintenance configuration id assigned to the database. This configuration defines the period when the maintenance updates will occur. </summary>
[WirePath("properties.maintenanceConfigurationId")]
public ResourceIdentifier MaintenanceConfigurationId { get; set; }
/// <summary> Whether or not this database is a ledger database, which means all tables in the database are ledger tables. Note: the value of this property cannot be changed after the database has been created. </summary>
[WirePath("properties.isLedgerOn")]
public bool? IsLedgerOn { get; set; }
/// <summary> Infra encryption is enabled for this database. </summary>
[WirePath("properties.isInfraEncryptionEnabled")]
public bool? IsInfraEncryptionEnabled { get; }
/// <summary> The Client id used for cross tenant per database CMK scenario. </summary>
[WirePath("properties.federatedClientId")]
public Guid? FederatedClientId { get; set; }
/// <summary> Type of enclave requested on the database i.e. Default or VBS enclaves. </summary>
[WirePath("properties.preferredEnclaveType")]
public SqlAlwaysEncryptedEnclaveType? PreferredEnclaveType { get; set; }
}
}