-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Replace Sql management client using generic rest client #11393
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 7 commits
e9132fd
5ecfadc
0d528a3
bf09638
b405c25
8fccf7b
b9a05cb
f0166dd
74f488f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| // ---------------------------------------------------------------------------------- | ||
| // | ||
| // Copyright Microsoft Corporation | ||
| // Licensed under the Apache License, Version 2.0 (the "License"); | ||
| // you may not use this file except in compliance with the License. | ||
| // You may obtain a copy of the License at | ||
| // http://www.apache.org/licenses/LICENSE-2.0 | ||
| // Unless required by applicable law or agreed to in writing, software | ||
| // distributed under the License is distributed on an "AS IS" BASIS, | ||
| // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| // See the License for the specific language governing permissions and | ||
| // limitations under the License. | ||
| // ---------------------------------------------------------------------------------- | ||
|
|
||
| using Microsoft.Rest.Azure; | ||
| using Newtonsoft.Json; | ||
| using System.Collections; | ||
| using System.Collections.Generic; | ||
|
|
||
| namespace Microsoft.Azure.Commands.Network.PrivateLinkService.Models | ||
| { | ||
| /// <summary> | ||
| /// Defines a page in Azure responses. | ||
| /// </summary> | ||
| /// <typeparam name="T">Type of the page content items</typeparam> | ||
| [JsonObject] | ||
| public class Page<T> : IPage<T> | ||
| { | ||
| /// <summary> | ||
| /// Gets the link to the next page. | ||
| /// </summary> | ||
| [JsonProperty("nextLink")] | ||
| public string NextPageLink { get; private set; } | ||
|
|
||
| [JsonProperty("value")] | ||
| private List<T> Items { get; set; } | ||
|
|
||
| /// <summary> | ||
| /// Returns an enumerator that iterates through the collection. | ||
| /// </summary> | ||
| /// <returns>A an enumerator that can be used to iterate through the collection.</returns> | ||
| public IEnumerator<T> GetEnumerator() | ||
| { | ||
| return Items == null ? System.Linq.Enumerable.Empty<T>().GetEnumerator() : Items.GetEnumerator(); | ||
| } | ||
|
|
||
| /// <summary> | ||
| /// Returns an enumerator that iterates through the collection. | ||
| /// </summary> | ||
| /// <returns>A an enumerator that can be used to iterate through the collection.</returns> | ||
| IEnumerator IEnumerable.GetEnumerator() | ||
| { | ||
| return GetEnumerator(); | ||
| } | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,91 @@ | ||
| // ---------------------------------------------------------------------------------- | ||
| // | ||
| // Copyright Microsoft Corporation | ||
| // Licensed under the Apache License, Version 2.0 (the "License"); | ||
| // you may not use this file except in compliance with the License. | ||
| // You may obtain a copy of the License at | ||
| // http://www.apache.org/licenses/LICENSE-2.0 | ||
| // Unless required by applicable law or agreed to in writing, software | ||
| // distributed under the License is distributed on an "AS IS" BASIS, | ||
| // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| // See the License for the specific language governing permissions and | ||
| // limitations under the License. | ||
| // ---------------------------------------------------------------------------------- | ||
|
|
||
| using Newtonsoft.Json; | ||
|
|
||
| namespace Microsoft.Azure.Commands.Network.PrivateLinkService.Models | ||
| { | ||
| /// <summary> | ||
| /// A private endpoint connection | ||
| /// </summary> | ||
| [Rest.Serialization.JsonTransformation] | ||
| public partial class PrivateEndpointConnection : ProxyResource | ||
| { | ||
| /// <summary> | ||
| /// Initializes a new instance of the PrivateEndpointConnection class. | ||
| /// </summary> | ||
| public PrivateEndpointConnection() | ||
| { | ||
| CustomInit(); | ||
| } | ||
|
|
||
| /// <summary> | ||
| /// Initializes a new instance of the PrivateEndpointConnection class. | ||
| /// </summary> | ||
| /// <param name="id">Resource ID.</param> | ||
| /// <param name="name">Resource name.</param> | ||
| /// <param name="type">Resource type.</param> | ||
| /// <param name="privateEndpoint">Private endpoint which the connection | ||
| /// belongs to.</param> | ||
| /// <param name="privateLinkServiceConnectionState">Connection state of | ||
| /// the private endpoint connection.</param> | ||
| /// <param name="provisioningState">State of the private endpoint | ||
| /// connection.</param> | ||
| public PrivateEndpointConnection(string id = default(string), string name = default(string), string type = default(string), PrivateEndpointProperty privateEndpoint = default(PrivateEndpointProperty), PrivateLinkServiceConnectionStateProperty privateLinkServiceConnectionState = default(PrivateLinkServiceConnectionStateProperty), string provisioningState = default(string)) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: usually we use null as default value for reference object instead of default(xxx), I guess this is generated code, so should be fine.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. copied from generated code. |
||
| : base(id, name, type) | ||
| { | ||
| PrivateEndpoint = privateEndpoint; | ||
| PrivateLinkServiceConnectionState = privateLinkServiceConnectionState; | ||
| ProvisioningState = provisioningState; | ||
| CustomInit(); | ||
| } | ||
|
|
||
| /// <summary> | ||
| /// An initialization method that performs custom operations like setting defaults | ||
| /// </summary> | ||
| partial void CustomInit(); | ||
|
|
||
| /// <summary> | ||
| /// Gets or sets private endpoint which the connection belongs to. | ||
| /// </summary> | ||
| [JsonProperty(PropertyName = "properties.privateEndpoint")] | ||
| public PrivateEndpointProperty PrivateEndpoint { get; set; } | ||
|
|
||
| /// <summary> | ||
| /// Gets or sets connection state of the private endpoint connection. | ||
| /// </summary> | ||
| [JsonProperty(PropertyName = "properties.privateLinkServiceConnectionState")] | ||
| public PrivateLinkServiceConnectionStateProperty PrivateLinkServiceConnectionState { get; set; } | ||
|
|
||
| /// <summary> | ||
| /// Gets state of the private endpoint connection. | ||
| /// </summary> | ||
| [JsonProperty(PropertyName = "properties.provisioningState")] | ||
| public string ProvisioningState { get; private set; } | ||
|
|
||
| /// <summary> | ||
| /// Validate the object. | ||
| /// </summary> | ||
| /// <exception cref="ValidationException"> | ||
| /// Thrown if validation fails | ||
| /// </exception> | ||
| public virtual void Validate() | ||
| { | ||
| if (PrivateLinkServiceConnectionState != null) | ||
| { | ||
| PrivateLinkServiceConnectionState.Validate(); | ||
| } | ||
| } | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| // ---------------------------------------------------------------------------------- | ||
| // | ||
| // Copyright Microsoft Corporation | ||
| // Licensed under the Apache License, Version 2.0 (the "License"); | ||
| // you may not use this file except in compliance with the License. | ||
| // You may obtain a copy of the License at | ||
| // http://www.apache.org/licenses/LICENSE-2.0 | ||
| // Unless required by applicable law or agreed to in writing, software | ||
| // distributed under the License is distributed on an "AS IS" BASIS, | ||
| // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| // See the License for the specific language governing permissions and | ||
| // limitations under the License. | ||
| // ---------------------------------------------------------------------------------- | ||
|
|
||
| using Microsoft.Rest.Azure; | ||
| using Newtonsoft.Json; | ||
|
|
||
| namespace Microsoft.Azure.Commands.Network.PrivateLinkService.Models | ||
| { | ||
| public partial class PrivateEndpointProperty : IResource | ||
| { | ||
| /// <summary> | ||
| /// Initializes a new instance of the PrivateEndpointProperty class. | ||
| /// </summary> | ||
| public PrivateEndpointProperty() | ||
| { | ||
| CustomInit(); | ||
| } | ||
|
|
||
| /// <summary> | ||
| /// Initializes a new instance of the PrivateEndpointProperty class. | ||
| /// </summary> | ||
| /// <param name="id">Resource id of the private endpoint.</param> | ||
| public PrivateEndpointProperty(string id = default(string)) | ||
| { | ||
| Id = id; | ||
| CustomInit(); | ||
| } | ||
|
|
||
| /// <summary> | ||
| /// An initialization method that performs custom operations like setting defaults | ||
| /// </summary> | ||
| partial void CustomInit(); | ||
|
|
||
| /// <summary> | ||
| /// Gets or sets resource id of the private endpoint. | ||
| /// </summary> | ||
| [JsonProperty(PropertyName = "id")] | ||
| public string Id { get; set; } | ||
|
|
||
| } | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: suggest to use using namespace
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
using this one now.
using NM = Microsoft.Azure.Management.Network.Models;