Skip to content

Commit 639ecbe

Browse files
authored
Generate SDK.Net from swagger 'SQL database, elastic pool, and capabilities 2017-10-01-preview', and re-recording all Sql tests
2 parents f04e5fa + d457298 commit 639ecbe

File tree

130 files changed

+54782
-26462
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

130 files changed

+54782
-26462
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
22
<!--This file and it's contents are updated at build time moving or editing might result in build failure. Take due deligence while editing this file-->
33
<PropertyGroup>
4-
<AzureApiTag>Sql_2017-03-01-preview;Sql_2014-04-01;Sql_2015-05-01-preview;Sql_2017-10-01-preview;</AzureApiTag>
4+
<AzureApiTag>Sql_2017-03-01-preview;Sql_2017-10-01-preview;Sql_2014-04-01;Sql_2015-05-01-preview;</AzureApiTag>
55
<PackageTags>$(PackageTags);$(CommonTags);$(AzureApiTag);</PackageTags>
66
</PropertyGroup>
77
</Project>
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
2+
// Licensed under the MIT License. See License.txt in the project root for
3+
// license information.
4+
5+
namespace Microsoft.Azure.Management.Sql.Models
6+
{
7+
using System;
8+
using System.Linq;
9+
using Newtonsoft.Json;
10+
11+
public partial class Database : TrackedResource
12+
{
13+
/// <summary>
14+
/// Gets the edition of the database. If createMode is OnlineSecondary, this value is
15+
/// ignored.To see possible values, query the capabilities API
16+
/// (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities)
17+
/// referred to by operationId: "Capabilities_ListByLocation." or use the Azure CLI
18+
/// command az sql db list-editions -l westus --query[].name. Possible values include:
19+
/// 'Web', 'Business', 'Basic', 'Standard', 'Premium', 'PremiumRS', 'Free', 'Stretch',
20+
/// 'DataWarehouse', 'System', 'System2'
21+
/// </summary>
22+
[JsonIgnore]
23+
public string Edition
24+
{
25+
get
26+
{
27+
return Sku?.Tier;
28+
}
29+
}
30+
31+
/// <summary>
32+
/// Gets the current service level objective of the database.
33+
/// </summary>
34+
[JsonIgnore]
35+
public string ServiceLevelObjective
36+
{
37+
get
38+
{
39+
return CurrentServiceObjectiveName;
40+
}
41+
}
42+
43+
/// <summary>
44+
/// Gets the name of the elastic pool the database is in. If elasticPoolName and
45+
/// requestedServiceObjectiveName are both updated, the value of
46+
/// requestedServiceObjectiveName is ignored. Not supported for DataWarehouse
47+
/// edition.
48+
/// </summary>
49+
[JsonIgnore]
50+
public string ElasticPoolName
51+
{
52+
get
53+
{
54+
return ResourceIdHelpers.GetLastSegment(ElasticPoolId);
55+
}
56+
}
57+
}
58+
}
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
2+
// Licensed under the MIT License. See License.txt in the project root for
3+
// license information.
4+
5+
namespace Microsoft.Azure.Management.Sql.Models
6+
{
7+
using System;
8+
using System.Linq;
9+
using Newtonsoft.Json;
10+
11+
public partial class DatabaseUpdate : TrackedResource
12+
{
13+
/// <summary>
14+
/// Gets the edition of the database. If createMode is OnlineSecondary, this value is
15+
/// ignored.To see possible values, query the capabilities API
16+
/// (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities)
17+
/// referred to by operationId: "Capabilities_ListByLocation." or use the Azure CLI
18+
/// command az sql db list-editions -l westus --query[].name. Possible values include:
19+
/// 'Web', 'Business', 'Basic', 'Standard', 'Premium', 'PremiumRS', 'Free', 'Stretch',
20+
/// 'DataWarehouse', 'System', 'System2'
21+
/// </summary>
22+
public string Edition
23+
{
24+
get
25+
{
26+
return Sku?.Tier;
27+
}
28+
}
29+
30+
/// <summary>
31+
/// Gets the current service level objective of the database.
32+
/// </summary>
33+
public string ServiceLevelObjective
34+
{
35+
get
36+
{
37+
return CurrentServiceObjectiveName;
38+
}
39+
}
40+
41+
/// <summary>
42+
/// Gets the name of the elastic pool the database is in. If elasticPoolName and
43+
/// requestedServiceObjectiveName are both updated, the value of
44+
/// requestedServiceObjectiveName is ignored. Not supported for DataWarehouse
45+
/// edition.
46+
/// </summary>
47+
public string ElasticPoolName
48+
{
49+
get
50+
{
51+
return ResourceIdHelpers.GetLastSegment(ElasticPoolId);
52+
}
53+
}
54+
}
55+
}
Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
2+
// Licensed under the MIT License. See License.txt in the project root for
3+
// license information.
4+
5+
namespace Microsoft.Azure.Management.Sql.Models
6+
{
7+
using System;
8+
using System.Linq;
9+
using Newtonsoft.Json;
10+
11+
public partial class ElasticPool : TrackedResource
12+
{
13+
/// <summary>
14+
/// Gets or sets the edition of the elastic pool. Possible values include: 'Basic', 'Standard', 'Premium'
15+
/// </summary>
16+
public string Edition
17+
{
18+
get
19+
{
20+
return Sku?.Tier;
21+
}
22+
}
23+
24+
/// <summary>
25+
/// Gets the total shared DTU for the database elastic pool.
26+
/// </summary>
27+
public int? Dtu
28+
{
29+
get
30+
{
31+
return Sku?.Capacity;
32+
}
33+
}
34+
35+
/// <summary>
36+
/// Gets storage limit for the database elastic pool in MB.
37+
/// </summary>
38+
public int? StorageMB
39+
{
40+
get
41+
{
42+
if (MaxSizeBytes == null)
43+
{
44+
return null;
45+
}
46+
47+
return (int)(MaxSizeBytes / 1024 / 1024);
48+
}
49+
set
50+
{
51+
MaxSizeBytes = value * 1024 * 1024;
52+
}
53+
}
54+
55+
/// <summary>
56+
/// Gets or sets the minimum DTU all databases are guaranteed.
57+
/// </summary>
58+
[JsonIgnore]
59+
public int? DatabaseDtuMin
60+
{
61+
get
62+
{
63+
return (int?)PerDatabaseSettings?.MinCapacity;
64+
}
65+
set
66+
{
67+
if (PerDatabaseSettings == null)
68+
{
69+
PerDatabaseSettings = new ElasticPoolPerDatabaseSettings();
70+
}
71+
72+
PerDatabaseSettings.MinCapacity = value;
73+
}
74+
}
75+
76+
/// <summary>
77+
/// Gets or sets the maximum DTU any one database can consume.
78+
/// </summary>
79+
[JsonIgnore]
80+
public int? DatabaseDtuMax
81+
{
82+
get
83+
{
84+
return (int?)PerDatabaseSettings?.MaxCapacity;
85+
}
86+
set
87+
{
88+
if (PerDatabaseSettings == null)
89+
{
90+
PerDatabaseSettings = new ElasticPoolPerDatabaseSettings();
91+
}
92+
93+
PerDatabaseSettings.MaxCapacity = value;
94+
}
95+
}
96+
}
97+
}
Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
2+
// Licensed under the MIT License. See License.txt in the project root for
3+
// license information.
4+
5+
namespace Microsoft.Azure.Management.Sql.Models
6+
{
7+
using System;
8+
using System.Linq;
9+
using Newtonsoft.Json;
10+
11+
public partial class ElasticPoolUpdate : TrackedResource
12+
{
13+
/// <summary>
14+
/// Gets or sets the edition of the elastic pool. Possible values include: 'Basic', 'Standard', 'Premium'
15+
/// </summary>
16+
public string Edition
17+
{
18+
get
19+
{
20+
return Sku?.Tier;
21+
}
22+
}
23+
24+
/// <summary>
25+
/// Gets the total shared DTU for the database elastic pool.
26+
/// </summary>
27+
public int? Dtu
28+
{
29+
get
30+
{
31+
return Sku?.Capacity;
32+
}
33+
}
34+
35+
/// <summary>
36+
/// Gets storage limit for the database elastic pool in MB.
37+
/// </summary>
38+
public int? StorageMB
39+
{
40+
get
41+
{
42+
if (MaxSizeBytes == null)
43+
{
44+
return null;
45+
}
46+
47+
return (int)(MaxSizeBytes / 1024 / 1024);
48+
}
49+
set
50+
{
51+
MaxSizeBytes = value * 1024 * 1024;
52+
}
53+
}
54+
55+
/// <summary>
56+
/// Gets or sets the minimum DTU all databases are guaranteed.
57+
/// </summary>
58+
[JsonIgnore]
59+
public int? DatabaseDtuMin
60+
{
61+
get
62+
{
63+
return (int?)PerDatabaseSettings?.MinCapacity;
64+
}
65+
set
66+
{
67+
if (PerDatabaseSettings == null)
68+
{
69+
PerDatabaseSettings = new ElasticPoolPerDatabaseSettings();
70+
}
71+
72+
PerDatabaseSettings.MinCapacity = value;
73+
}
74+
}
75+
76+
/// <summary>
77+
/// Gets or sets the maximum DTU any one database can consume.
78+
/// </summary>
79+
[JsonIgnore]
80+
public int? DatabaseDtuMax
81+
{
82+
get
83+
{
84+
return (int?)PerDatabaseSettings?.MaxCapacity;
85+
}
86+
set
87+
{
88+
if (PerDatabaseSettings == null)
89+
{
90+
PerDatabaseSettings = new ElasticPoolPerDatabaseSettings();
91+
}
92+
93+
PerDatabaseSettings.MaxCapacity = value;
94+
}
95+
}
96+
}
97+
}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
2+
// Licensed under the MIT License. See License.txt in the project root for
3+
// license information.
4+
5+
namespace Microsoft.Azure.Management.Sql
6+
{
7+
using System;
8+
using System.Linq;
9+
10+
/// <summary>
11+
/// Helpers methods for working with resource ids.
12+
/// </summary>
13+
internal static class ResourceIdHelpers
14+
{
15+
/// <summary>
16+
/// Gets the last segments of a resource id, or null if the id is null.
17+
/// </summary>
18+
/// <param name="resourceId">The resource id.</param>
19+
public static string GetLastSegment(string resourceId)
20+
{
21+
if (resourceId == null)
22+
{
23+
return null;
24+
}
25+
26+
// Uri.Segments is only supported for absolute uris, so we give
27+
// a fake host name.
28+
Uri uri = new Uri(
29+
new Uri("https://my.example"), // Dummy host name
30+
resourceId);
31+
32+
return uri.Segments.Last();
33+
}
34+
}
35+
}

0 commit comments

Comments
 (0)