-
Notifications
You must be signed in to change notification settings - Fork 4.5k
/
ManagedDatabaseData.cs
169 lines (161 loc) · 12.7 KB
/
ManagedDatabaseData.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
// 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;
using Azure.ResourceManager.Models;
using Azure.ResourceManager.Sql.Models;
namespace Azure.ResourceManager.Sql
{
/// <summary>
/// A class representing the ManagedDatabase data model.
/// A managed database resource.
/// </summary>
public partial class ManagedDatabaseData : TrackedResourceData
{
/// <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="ManagedDatabaseData"/>. </summary>
/// <param name="location"> The location. </param>
public ManagedDatabaseData(AzureLocation location) : base(location)
{
}
/// <summary> Initializes a new instance of <see cref="ManagedDatabaseData"/>. </summary>
/// <param name="id"> The id. </param>
/// <param name="name"> The name. </param>
/// <param name="resourceType"> The resourceType. </param>
/// <param name="systemData"> The systemData. </param>
/// <param name="tags"> The tags. </param>
/// <param name="location"> The location. </param>
/// <param name="collation"> Collation of the managed database. </param>
/// <param name="status"> Status of the database. </param>
/// <param name="createdOn"> Creation date of the database. </param>
/// <param name="earliestRestorePoint"> Earliest restore point in time for point in time restore. </param>
/// <param name="restorePointInTime"> Conditional. If createMode is PointInTimeRestore, this value is required. Specifies the point in time (ISO8601 format) of the source database that will be restored to create the new database. </param>
/// <param name="defaultSecondaryLocation"> Geo paired region. </param>
/// <param name="catalogCollation"> Collation of the metadata catalog. </param>
/// <param name="createMode"> Managed database create mode. PointInTimeRestore: Create a database by restoring a point in time backup of an existing database. SourceDatabaseName, SourceManagedInstanceName and PointInTime must be specified. RestoreExternalBackup: Create a database by restoring from external backup files. Collation, StorageContainerUri and StorageContainerSasToken must be specified. Recovery: Creates a database by restoring a geo-replicated backup. RecoverableDatabaseId must be specified as the recoverable database resource ID to restore. RestoreLongTermRetentionBackup: Create a database by restoring from a long term retention backup (longTermRetentionBackupResourceId required). </param>
/// <param name="storageContainerUri"> Conditional. If createMode is RestoreExternalBackup, this value is required. Specifies the uri of the storage container where backups for this restore are stored. </param>
/// <param name="sourceDatabaseId"> The resource identifier of the source database associated with create operation of this database. </param>
/// <param name="restorableDroppedDatabaseId"> The restorable dropped database resource id to restore when creating this database. </param>
/// <param name="storageContainerIdentity"> Conditional. If createMode is RestoreExternalBackup, this value is used. Specifies the identity used for storage container authentication. Can be 'SharedAccessSignature' or 'ManagedIdentity'; if not specified 'SharedAccessSignature' is assumed. </param>
/// <param name="storageContainerSasToken"> Conditional. If createMode is RestoreExternalBackup and storageContainerIdentity is not ManagedIdentity, this value is required. Specifies the storage container sas token. </param>
/// <param name="failoverGroupId"> Instance Failover Group resource identifier that this managed database belongs to. </param>
/// <param name="recoverableDatabaseId"> The resource identifier of the recoverable database associated with create operation of this database. </param>
/// <param name="longTermRetentionBackupResourceId"> The name of the Long Term Retention backup to be used for restore of this managed database. </param>
/// <param name="allowAutoCompleteRestore"> Whether to auto complete restore of this managed database. </param>
/// <param name="lastBackupName"> Last backup file name for restore of this managed database. </param>
/// <param name="serializedAdditionalRawData"> Keeps track of any properties unknown to the library. </param>
internal ManagedDatabaseData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary<string, string> tags, AzureLocation location, string collation, ManagedDatabaseStatus? status, DateTimeOffset? createdOn, DateTimeOffset? earliestRestorePoint, DateTimeOffset? restorePointInTime, AzureLocation? defaultSecondaryLocation, CatalogCollationType? catalogCollation, ManagedDatabaseCreateMode? createMode, Uri storageContainerUri, ResourceIdentifier sourceDatabaseId, ResourceIdentifier restorableDroppedDatabaseId, string storageContainerIdentity, string storageContainerSasToken, ResourceIdentifier failoverGroupId, ResourceIdentifier recoverableDatabaseId, ResourceIdentifier longTermRetentionBackupResourceId, bool? allowAutoCompleteRestore, string lastBackupName, IDictionary<string, BinaryData> serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location)
{
Collation = collation;
Status = status;
CreatedOn = createdOn;
EarliestRestorePoint = earliestRestorePoint;
RestorePointInTime = restorePointInTime;
DefaultSecondaryLocation = defaultSecondaryLocation;
CatalogCollation = catalogCollation;
CreateMode = createMode;
StorageContainerUri = storageContainerUri;
SourceDatabaseId = sourceDatabaseId;
RestorableDroppedDatabaseId = restorableDroppedDatabaseId;
StorageContainerIdentity = storageContainerIdentity;
StorageContainerSasToken = storageContainerSasToken;
FailoverGroupId = failoverGroupId;
RecoverableDatabaseId = recoverableDatabaseId;
LongTermRetentionBackupResourceId = longTermRetentionBackupResourceId;
AllowAutoCompleteRestore = allowAutoCompleteRestore;
LastBackupName = lastBackupName;
_serializedAdditionalRawData = serializedAdditionalRawData;
}
/// <summary> Initializes a new instance of <see cref="ManagedDatabaseData"/> for deserialization. </summary>
internal ManagedDatabaseData()
{
}
/// <summary> Collation of the managed database. </summary>
[WirePath("properties.collation")]
public string Collation { get; set; }
/// <summary> Status of the database. </summary>
[WirePath("properties.status")]
public ManagedDatabaseStatus? Status { get; }
/// <summary> Creation date of the database. </summary>
[WirePath("properties.creationDate")]
public DateTimeOffset? CreatedOn { get; }
/// <summary> Earliest restore point in time for point in time restore. </summary>
[WirePath("properties.earliestRestorePoint")]
public DateTimeOffset? EarliestRestorePoint { get; }
/// <summary> Conditional. If createMode is PointInTimeRestore, this value is required. 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> Geo paired region. </summary>
[WirePath("properties.defaultSecondaryLocation")]
public AzureLocation? DefaultSecondaryLocation { get; }
/// <summary> Collation of the metadata catalog. </summary>
[WirePath("properties.catalogCollation")]
public CatalogCollationType? CatalogCollation { get; set; }
/// <summary> Managed database create mode. PointInTimeRestore: Create a database by restoring a point in time backup of an existing database. SourceDatabaseName, SourceManagedInstanceName and PointInTime must be specified. RestoreExternalBackup: Create a database by restoring from external backup files. Collation, StorageContainerUri and StorageContainerSasToken must be specified. Recovery: Creates a database by restoring a geo-replicated backup. RecoverableDatabaseId must be specified as the recoverable database resource ID to restore. RestoreLongTermRetentionBackup: Create a database by restoring from a long term retention backup (longTermRetentionBackupResourceId required). </summary>
[WirePath("properties.createMode")]
public ManagedDatabaseCreateMode? CreateMode { get; set; }
/// <summary> Conditional. If createMode is RestoreExternalBackup, this value is required. Specifies the uri of the storage container where backups for this restore are stored. </summary>
[WirePath("properties.storageContainerUri")]
public Uri StorageContainerUri { 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 restorable dropped database resource id to restore when creating this database. </summary>
[WirePath("properties.restorableDroppedDatabaseId")]
public ResourceIdentifier RestorableDroppedDatabaseId { get; set; }
/// <summary> Conditional. If createMode is RestoreExternalBackup, this value is used. Specifies the identity used for storage container authentication. Can be 'SharedAccessSignature' or 'ManagedIdentity'; if not specified 'SharedAccessSignature' is assumed. </summary>
[WirePath("properties.storageContainerIdentity")]
public string StorageContainerIdentity { get; set; }
/// <summary> Conditional. If createMode is RestoreExternalBackup and storageContainerIdentity is not ManagedIdentity, this value is required. Specifies the storage container sas token. </summary>
[WirePath("properties.storageContainerSasToken")]
public string StorageContainerSasToken { get; set; }
/// <summary> Instance Failover Group resource identifier that this managed database belongs to. </summary>
[WirePath("properties.failoverGroupId")]
public ResourceIdentifier FailoverGroupId { get; }
/// <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 name of the Long Term Retention backup to be used for restore of this managed database. </summary>
[WirePath("properties.longTermRetentionBackupResourceId")]
public ResourceIdentifier LongTermRetentionBackupResourceId { get; set; }
/// <summary> Whether to auto complete restore of this managed database. </summary>
[WirePath("properties.autoCompleteRestore")]
public bool? AllowAutoCompleteRestore { get; set; }
/// <summary> Last backup file name for restore of this managed database. </summary>
[WirePath("properties.lastBackupName")]
public string LastBackupName { get; set; }
}
}