Skip to content

Commit

Permalink
[ResourceGraph] Migrate Microsoft.Azure.Management.ResourceGraph to R…
Browse files Browse the repository at this point in the history
…esourceGraph.Management.Sdk (Azure#26469)

* Microsoft.Azure.Management.ResourceGraph

* title: ResourceGraphClient

* SDK migrate

* autorest powershell migrate

* Update ChangeLog.md
  • Loading branch information
JoyerJin authored Oct 25, 2024
1 parent ccf7f84 commit 4d784fa
Show file tree
Hide file tree
Showing 35 changed files with 2,786 additions and 18 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
// 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.ResourceGraph
{
using Microsoft.Rest.Azure;
using Models;

/// <summary>
/// Operations operations.
/// </summary>
public partial interface IOperations
{
/// <summary>
/// Lists all of the available REST API operations.
/// </summary>
/// <remarks>
/// Lists all of the available REST API operations.
/// </remarks>
/// <param name='customHeaders'>
/// The headers that will be added to request.
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
/// <exception cref="Microsoft.Rest.Azure.CloudException">
/// Thrown when the operation returned an invalid status code
/// </exception>
/// <exception cref="Microsoft.Rest.SerializationException">
/// Thrown when unable to deserialize the response
/// </exception>
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));

}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
// 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.ResourceGraph
{
using Microsoft.Rest;
using Microsoft.Rest.Azure;
using Models;

/// <summary>
/// Azure Resource Graph API Reference
/// </summary>
public partial interface IResourceGraphClient : System.IDisposable
{
/// <summary>
/// The base URI of the service.
/// </summary>
System.Uri BaseUri { get; set; }

/// <summary>
/// Gets or sets json serialization settings.
/// </summary>
Newtonsoft.Json.JsonSerializerSettings SerializationSettings { get; }

/// <summary>
/// Gets or sets json deserialization settings.
/// </summary>
Newtonsoft.Json.JsonSerializerSettings DeserializationSettings { get; }

/// <summary>
/// Credentials needed for the client to connect to Azure.
/// </summary>
Microsoft.Rest.ServiceClientCredentials Credentials { get;}


/// <summary>
/// The API version to use for this operation.
/// </summary>
string ApiVersion { get;}


/// <summary>
/// The preferred language for the response.
/// </summary>
string AcceptLanguage { get; set;}


/// <summary>
/// The retry timeout in seconds for Long Running Operations. Default
/// /// value is 30.
/// </summary>
int? LongRunningOperationRetryTimeout { get; set;}


/// <summary>
/// Whether a unique x-ms-client-request-id should be generated. When
/// /// set to true a unique x-ms-client-request-id value is generated and
/// /// included in each request. Default is true.
/// </summary>
bool? GenerateClientRequestId { get; set;}


/// <summary>
/// Gets the IOperations
/// </summary>
IOperations Operations { get; }

/// <summary>
/// Queries the resources managed by Azure Resource Manager for scopes
/// specified in the request.
/// </summary>
/// <remarks>
/// Queries the resources managed by Azure Resource Manager for scopes
/// specified in the request.
/// </remarks>
/// <param name='query'>
/// Request specifying query and its options.
/// </param>
/// <param name='customHeaders'>
/// The headers that will be added to request.
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
/// <exception cref="Microsoft.Rest.Azure.CloudException">
/// Thrown when the operation returned an invalid status code
/// </exception>
/// <exception cref="Microsoft.Rest.SerializationException">
/// Thrown when unable to deserialize the response
/// </exception>
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));

}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
// 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.ResourceGraph.Models
{
using System.Linq;

/// <summary>
/// Query result column descriptor.
/// </summary>
public partial class Column
{
/// <summary>
/// Initializes a new instance of the Column class.
/// </summary>
public Column()
{
CustomInit();
}

/// <summary>
/// Initializes a new instance of the Column class.
/// </summary>

/// <param name="name">Column name.
/// </param>

/// <param name="type">Column data type.
/// Possible values include: &#39;string&#39;, &#39;integer&#39;, &#39;number&#39;, &#39;boolean&#39;, &#39;object&#39;</param>
public Column(string name, ColumnDataType type)

{
this.Name = name;
this.Type = type;
CustomInit();
}

/// <summary>
/// An initialization method that performs custom operations like setting defaults
/// </summary>
partial void CustomInit();


/// <summary>
/// Gets or sets column name.
/// </summary>
[Newtonsoft.Json.JsonProperty(PropertyName = "name")]
public string Name {get; set; }

/// <summary>
/// Gets or sets column data type. Possible values include: &#39;string&#39;, &#39;integer&#39;, &#39;number&#39;, &#39;boolean&#39;, &#39;object&#39;
/// </summary>
[Newtonsoft.Json.JsonProperty(PropertyName = "type")]
public ColumnDataType Type {get; set; }
/// <summary>
/// Validate the object.
/// </summary>
/// <exception cref="Microsoft.Rest.ValidationException">
/// Thrown if validation fails
/// </exception>
public virtual void Validate()
{
if (this.Name == null)
{
throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Name");
}


}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
// 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.ResourceGraph.Models
{

/// <summary>
/// Defines values for ColumnDataType.
/// </summary>


[Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))]
public enum ColumnDataType
{
[System.Runtime.Serialization.EnumMember(Value = "string")]
String,
[System.Runtime.Serialization.EnumMember(Value = "integer")]
Integer,
[System.Runtime.Serialization.EnumMember(Value = "number")]
Number,
[System.Runtime.Serialization.EnumMember(Value = "boolean")]
Boolean,
[System.Runtime.Serialization.EnumMember(Value = "object")]
Object
}
internal static class ColumnDataTypeEnumExtension
{
internal static string ToSerializedValue(this ColumnDataType? value)
{
return value == null ? null : ((ColumnDataType)value).ToSerializedValue();
}
internal static string ToSerializedValue(this ColumnDataType value)
{
switch( value )
{
case ColumnDataType.String:
return "string";
case ColumnDataType.Integer:
return "integer";
case ColumnDataType.Number:
return "number";
case ColumnDataType.Boolean:
return "boolean";
case ColumnDataType.Object:
return "object";
}
return null;
}
internal static ColumnDataType? ParseColumnDataType(this string value)
{
switch( value )
{
case "string":
return ColumnDataType.String;
case "integer":
return ColumnDataType.Integer;
case "number":
return ColumnDataType.Number;
case "boolean":
return ColumnDataType.Boolean;
case "object":
return ColumnDataType.Object;
}
return null;
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
// 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.ResourceGraph.Models
{
using System.Linq;

/// <summary>
/// Error details.
/// </summary>
/// <remarks>
/// Error details.
/// </remarks>
public partial class Error
{
/// <summary>
/// Initializes a new instance of the Error class.
/// </summary>
public Error()
{
CustomInit();
}

/// <summary>
/// Initializes a new instance of the Error class.
/// </summary>

/// <param name="code">Error code identifying the specific error.
/// </param>

/// <param name="message">A human readable error message.
/// </param>

/// <param name="details">Error details
/// </param>
public Error(string code, string message, System.Collections.Generic.IList<ErrorDetails> details = default(System.Collections.Generic.IList<ErrorDetails>))

{
this.Code = code;
this.Message = message;
this.Details = details;
CustomInit();
}

/// <summary>
/// An initialization method that performs custom operations like setting defaults
/// </summary>
partial void CustomInit();


/// <summary>
/// Gets or sets error code identifying the specific error.
/// </summary>
[Newtonsoft.Json.JsonProperty(PropertyName = "code")]
public string Code {get; set; }

/// <summary>
/// Gets or sets a human readable error message.
/// </summary>
[Newtonsoft.Json.JsonProperty(PropertyName = "message")]
public string Message {get; set; }

/// <summary>
/// Gets or sets error details
/// </summary>
[Newtonsoft.Json.JsonProperty(PropertyName = "details")]
public System.Collections.Generic.IList<ErrorDetails> Details {get; set; }
/// <summary>
/// Validate the object.
/// </summary>
/// <exception cref="Microsoft.Rest.ValidationException">
/// Thrown if validation fails
/// </exception>
public virtual void Validate()
{
if (this.Code == null)
{
throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Code");
}
if (this.Message == null)
{
throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Message");
}


if (this.Details != null)
{
foreach (var element in this.Details)
{
if (element != null)
{
element.Validate();
}
}
}
}
}
}
Loading

0 comments on commit 4d784fa

Please sign in to comment.