Skip to content
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,22 @@ public VirtualNetworkRule()
/// <summary>
/// Initializes a new instance of the VirtualNetworkRule class.
/// </summary>
/// <param name="virtualNetworkSubnetId">The ARM resource id of the
/// virtual network subnet.</param>
/// <param name="id">Resource ID.</param>
/// <param name="name">Resource name.</param>
/// <param name="type">Resource type.</param>
/// <param name="virtualNetworkSubnetId">The resource ID of the virtual
/// network subnet</param>
public VirtualNetworkRule(string id = default(string), string name = default(string), string type = default(string), string virtualNetworkSubnetId = default(string))
/// <param name="ignoreVnetPrivateAccessConfiguration">Create firewall
/// rule before the virtual network has private access enabled.</param>
/// <param name="state">Virtual network rule state. Possible values
/// include: 'Initializing', 'InProgress', 'Ready', 'Deleting',
/// 'Unknown'</param>
public VirtualNetworkRule(string virtualNetworkSubnetId, string id = default(string), string name = default(string), string type = default(string), bool? ignoreVnetPrivateAccessConfiguration = default(bool?), string state = default(string))
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dnayantara you already have tests for the newly added parameter?
The description of the PR was confusing?
Yes the existing tests will work, but what about testing the new parameter?

Copy link
Copy Markdown
Contributor Author

@dnayantara dnayantara Aug 2, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code is not deployed in production yet. I will update the tests once that happens. Then new client code has been internally tested successfully.

: base(id, name, type)
{
VirtualNetworkSubnetId = virtualNetworkSubnetId;
IgnoreVnetPrivateAccessConfiguration = ignoreVnetPrivateAccessConfiguration;
State = state;
CustomInit();
}

Expand All @@ -51,10 +58,37 @@ public VirtualNetworkRule()
partial void CustomInit();

/// <summary>
/// Gets or sets the resource ID of the virtual network subnet
/// Gets or sets the ARM resource id of the virtual network subnet.
/// </summary>
[JsonProperty(PropertyName = "properties.virtualNetworkSubnetId")]
public string VirtualNetworkSubnetId { get; set; }

/// <summary>
/// Gets or sets create firewall rule before the virtual network has
/// private access enabled.
/// </summary>
[JsonProperty(PropertyName = "properties.ignoreVnetPrivateAccessConfiguration")]
public bool? IgnoreVnetPrivateAccessConfiguration { get; set; }

/// <summary>
/// Gets virtual network rule state. Possible values include:
/// 'Initializing', 'InProgress', 'Ready', 'Deleting', 'Unknown'
/// </summary>
[JsonProperty(PropertyName = "properties.state")]
public string State { get; private set; }

/// <summary>
/// Validate the object.
/// </summary>
/// <exception cref="ValidationException">
/// Thrown if validation fails
/// </exception>
public virtual void Validate()
{
if (VirtualNetworkSubnetId == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "VirtualNetworkSubnetId");
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for
// license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.

namespace Microsoft.Azure.Management.Sql.Models
{
using Microsoft.Azure;
using Microsoft.Azure.Management;
using Microsoft.Azure.Management.Sql;

/// <summary>
/// Defines values for VirtualNetworkRuleState.
/// </summary>
public static class VirtualNetworkRuleState
{
public const string Initializing = "Initializing";
public const string InProgress = "InProgress";
public const string Ready = "Ready";
public const string Deleting = "Deleting";
public const string Unknown = "Unknown";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -559,6 +559,10 @@ internal VirtualNetworkRulesOperations(SqlManagementClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "parameters");
}
if (parameters != null)
{
parameters.Validate();
}
if (Client.SubscriptionId == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
Expand Down

Large diffs are not rendered by default.

Loading