Skip to content

Commit 4d784fa

Browse files
authored
[ResourceGraph] Migrate Microsoft.Azure.Management.ResourceGraph to ResourceGraph.Management.Sdk (#26469)
* Microsoft.Azure.Management.ResourceGraph * title: ResourceGraphClient * SDK migrate * autorest powershell migrate * Update ChangeLog.md
1 parent ccf7f84 commit 4d784fa

35 files changed

+2786
-18
lines changed
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
2+
// Licensed under the MIT License. See License.txt in the project root for license information.
3+
// Code generated by Microsoft (R) AutoRest Code Generator.
4+
// Changes may cause incorrect behavior and will be lost if the code is regenerated.
5+
6+
namespace Microsoft.Azure.Management.ResourceGraph
7+
{
8+
using Microsoft.Rest.Azure;
9+
using Models;
10+
11+
/// <summary>
12+
/// Operations operations.
13+
/// </summary>
14+
public partial interface IOperations
15+
{
16+
/// <summary>
17+
/// Lists all of the available REST API operations.
18+
/// </summary>
19+
/// <remarks>
20+
/// Lists all of the available REST API operations.
21+
/// </remarks>
22+
/// <param name='customHeaders'>
23+
/// The headers that will be added to request.
24+
/// </param>
25+
/// <param name='cancellationToken'>
26+
/// The cancellation token.
27+
/// </param>
28+
/// <exception cref="Microsoft.Rest.Azure.CloudException">
29+
/// Thrown when the operation returned an invalid status code
30+
/// </exception>
31+
/// <exception cref="Microsoft.Rest.SerializationException">
32+
/// Thrown when unable to deserialize the response
33+
/// </exception>
34+
System.Threading.Tasks.Task<Microsoft.Rest.Azure.AzureOperationResponse<System.Collections.Generic.IEnumerable<Operation>>> ListWithHttpMessagesAsync(System.Collections.Generic.Dictionary<string, System.Collections.Generic.List<string>> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
35+
36+
}
37+
}
Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
2+
// Licensed under the MIT License. See License.txt in the project root for license information.
3+
// Code generated by Microsoft (R) AutoRest Code Generator.
4+
// Changes may cause incorrect behavior and will be lost if the code is regenerated.
5+
6+
namespace Microsoft.Azure.Management.ResourceGraph
7+
{
8+
using Microsoft.Rest;
9+
using Microsoft.Rest.Azure;
10+
using Models;
11+
12+
/// <summary>
13+
/// Azure Resource Graph API Reference
14+
/// </summary>
15+
public partial interface IResourceGraphClient : System.IDisposable
16+
{
17+
/// <summary>
18+
/// The base URI of the service.
19+
/// </summary>
20+
System.Uri BaseUri { get; set; }
21+
22+
/// <summary>
23+
/// Gets or sets json serialization settings.
24+
/// </summary>
25+
Newtonsoft.Json.JsonSerializerSettings SerializationSettings { get; }
26+
27+
/// <summary>
28+
/// Gets or sets json deserialization settings.
29+
/// </summary>
30+
Newtonsoft.Json.JsonSerializerSettings DeserializationSettings { get; }
31+
32+
/// <summary>
33+
/// Credentials needed for the client to connect to Azure.
34+
/// </summary>
35+
Microsoft.Rest.ServiceClientCredentials Credentials { get;}
36+
37+
38+
/// <summary>
39+
/// The API version to use for this operation.
40+
/// </summary>
41+
string ApiVersion { get;}
42+
43+
44+
/// <summary>
45+
/// The preferred language for the response.
46+
/// </summary>
47+
string AcceptLanguage { get; set;}
48+
49+
50+
/// <summary>
51+
/// The retry timeout in seconds for Long Running Operations. Default
52+
/// /// value is 30.
53+
/// </summary>
54+
int? LongRunningOperationRetryTimeout { get; set;}
55+
56+
57+
/// <summary>
58+
/// Whether a unique x-ms-client-request-id should be generated. When
59+
/// /// set to true a unique x-ms-client-request-id value is generated and
60+
/// /// included in each request. Default is true.
61+
/// </summary>
62+
bool? GenerateClientRequestId { get; set;}
63+
64+
65+
/// <summary>
66+
/// Gets the IOperations
67+
/// </summary>
68+
IOperations Operations { get; }
69+
70+
/// <summary>
71+
/// Queries the resources managed by Azure Resource Manager for scopes
72+
/// specified in the request.
73+
/// </summary>
74+
/// <remarks>
75+
/// Queries the resources managed by Azure Resource Manager for scopes
76+
/// specified in the request.
77+
/// </remarks>
78+
/// <param name='query'>
79+
/// Request specifying query and its options.
80+
/// </param>
81+
/// <param name='customHeaders'>
82+
/// The headers that will be added to request.
83+
/// </param>
84+
/// <param name='cancellationToken'>
85+
/// The cancellation token.
86+
/// </param>
87+
/// <exception cref="Microsoft.Rest.Azure.CloudException">
88+
/// Thrown when the operation returned an invalid status code
89+
/// </exception>
90+
/// <exception cref="Microsoft.Rest.SerializationException">
91+
/// Thrown when unable to deserialize the response
92+
/// </exception>
93+
System.Threading.Tasks.Task<Microsoft.Rest.Azure.AzureOperationResponse<QueryResponse>> ResourcesWithHttpMessagesAsync(QueryRequest query, System.Collections.Generic.Dictionary<string, System.Collections.Generic.List<string>> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
94+
95+
}
96+
}
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
2+
// Licensed under the MIT License. See License.txt in the project root for license information.
3+
// Code generated by Microsoft (R) AutoRest Code Generator.
4+
// Changes may cause incorrect behavior and will be lost if the code is regenerated.
5+
6+
namespace Microsoft.Azure.Management.ResourceGraph.Models
7+
{
8+
using System.Linq;
9+
10+
/// <summary>
11+
/// Query result column descriptor.
12+
/// </summary>
13+
public partial class Column
14+
{
15+
/// <summary>
16+
/// Initializes a new instance of the Column class.
17+
/// </summary>
18+
public Column()
19+
{
20+
CustomInit();
21+
}
22+
23+
/// <summary>
24+
/// Initializes a new instance of the Column class.
25+
/// </summary>
26+
27+
/// <param name="name">Column name.
28+
/// </param>
29+
30+
/// <param name="type">Column data type.
31+
/// Possible values include: &#39;string&#39;, &#39;integer&#39;, &#39;number&#39;, &#39;boolean&#39;, &#39;object&#39;</param>
32+
public Column(string name, ColumnDataType type)
33+
34+
{
35+
this.Name = name;
36+
this.Type = type;
37+
CustomInit();
38+
}
39+
40+
/// <summary>
41+
/// An initialization method that performs custom operations like setting defaults
42+
/// </summary>
43+
partial void CustomInit();
44+
45+
46+
/// <summary>
47+
/// Gets or sets column name.
48+
/// </summary>
49+
[Newtonsoft.Json.JsonProperty(PropertyName = "name")]
50+
public string Name {get; set; }
51+
52+
/// <summary>
53+
/// Gets or sets column data type. Possible values include: &#39;string&#39;, &#39;integer&#39;, &#39;number&#39;, &#39;boolean&#39;, &#39;object&#39;
54+
/// </summary>
55+
[Newtonsoft.Json.JsonProperty(PropertyName = "type")]
56+
public ColumnDataType Type {get; set; }
57+
/// <summary>
58+
/// Validate the object.
59+
/// </summary>
60+
/// <exception cref="Microsoft.Rest.ValidationException">
61+
/// Thrown if validation fails
62+
/// </exception>
63+
public virtual void Validate()
64+
{
65+
if (this.Name == null)
66+
{
67+
throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Name");
68+
}
69+
70+
71+
}
72+
}
73+
}
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
2+
// Licensed under the MIT License. See License.txt in the project root for license information.
3+
// Code generated by Microsoft (R) AutoRest Code Generator.
4+
// Changes may cause incorrect behavior and will be lost if the code is regenerated.
5+
6+
namespace Microsoft.Azure.Management.ResourceGraph.Models
7+
{
8+
9+
/// <summary>
10+
/// Defines values for ColumnDataType.
11+
/// </summary>
12+
13+
14+
[Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))]
15+
public enum ColumnDataType
16+
{
17+
[System.Runtime.Serialization.EnumMember(Value = "string")]
18+
String,
19+
[System.Runtime.Serialization.EnumMember(Value = "integer")]
20+
Integer,
21+
[System.Runtime.Serialization.EnumMember(Value = "number")]
22+
Number,
23+
[System.Runtime.Serialization.EnumMember(Value = "boolean")]
24+
Boolean,
25+
[System.Runtime.Serialization.EnumMember(Value = "object")]
26+
Object
27+
}
28+
internal static class ColumnDataTypeEnumExtension
29+
{
30+
internal static string ToSerializedValue(this ColumnDataType? value)
31+
{
32+
return value == null ? null : ((ColumnDataType)value).ToSerializedValue();
33+
}
34+
internal static string ToSerializedValue(this ColumnDataType value)
35+
{
36+
switch( value )
37+
{
38+
case ColumnDataType.String:
39+
return "string";
40+
case ColumnDataType.Integer:
41+
return "integer";
42+
case ColumnDataType.Number:
43+
return "number";
44+
case ColumnDataType.Boolean:
45+
return "boolean";
46+
case ColumnDataType.Object:
47+
return "object";
48+
}
49+
return null;
50+
}
51+
internal static ColumnDataType? ParseColumnDataType(this string value)
52+
{
53+
switch( value )
54+
{
55+
case "string":
56+
return ColumnDataType.String;
57+
case "integer":
58+
return ColumnDataType.Integer;
59+
case "number":
60+
return ColumnDataType.Number;
61+
case "boolean":
62+
return ColumnDataType.Boolean;
63+
case "object":
64+
return ColumnDataType.Object;
65+
}
66+
return null;
67+
}
68+
}
69+
}
Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
2+
// Licensed under the MIT License. See License.txt in the project root for license information.
3+
// Code generated by Microsoft (R) AutoRest Code Generator.
4+
// Changes may cause incorrect behavior and will be lost if the code is regenerated.
5+
6+
namespace Microsoft.Azure.Management.ResourceGraph.Models
7+
{
8+
using System.Linq;
9+
10+
/// <summary>
11+
/// Error details.
12+
/// </summary>
13+
/// <remarks>
14+
/// Error details.
15+
/// </remarks>
16+
public partial class Error
17+
{
18+
/// <summary>
19+
/// Initializes a new instance of the Error class.
20+
/// </summary>
21+
public Error()
22+
{
23+
CustomInit();
24+
}
25+
26+
/// <summary>
27+
/// Initializes a new instance of the Error class.
28+
/// </summary>
29+
30+
/// <param name="code">Error code identifying the specific error.
31+
/// </param>
32+
33+
/// <param name="message">A human readable error message.
34+
/// </param>
35+
36+
/// <param name="details">Error details
37+
/// </param>
38+
public Error(string code, string message, System.Collections.Generic.IList<ErrorDetails> details = default(System.Collections.Generic.IList<ErrorDetails>))
39+
40+
{
41+
this.Code = code;
42+
this.Message = message;
43+
this.Details = details;
44+
CustomInit();
45+
}
46+
47+
/// <summary>
48+
/// An initialization method that performs custom operations like setting defaults
49+
/// </summary>
50+
partial void CustomInit();
51+
52+
53+
/// <summary>
54+
/// Gets or sets error code identifying the specific error.
55+
/// </summary>
56+
[Newtonsoft.Json.JsonProperty(PropertyName = "code")]
57+
public string Code {get; set; }
58+
59+
/// <summary>
60+
/// Gets or sets a human readable error message.
61+
/// </summary>
62+
[Newtonsoft.Json.JsonProperty(PropertyName = "message")]
63+
public string Message {get; set; }
64+
65+
/// <summary>
66+
/// Gets or sets error details
67+
/// </summary>
68+
[Newtonsoft.Json.JsonProperty(PropertyName = "details")]
69+
public System.Collections.Generic.IList<ErrorDetails> Details {get; set; }
70+
/// <summary>
71+
/// Validate the object.
72+
/// </summary>
73+
/// <exception cref="Microsoft.Rest.ValidationException">
74+
/// Thrown if validation fails
75+
/// </exception>
76+
public virtual void Validate()
77+
{
78+
if (this.Code == null)
79+
{
80+
throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Code");
81+
}
82+
if (this.Message == null)
83+
{
84+
throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Message");
85+
}
86+
87+
88+
if (this.Details != null)
89+
{
90+
foreach (var element in this.Details)
91+
{
92+
if (element != null)
93+
{
94+
element.Validate();
95+
}
96+
}
97+
}
98+
}
99+
}
100+
}

0 commit comments

Comments
 (0)