Skip to content

Commit

Permalink
.NET SDK Resource Provider:'ResourceGraph'
Browse files Browse the repository at this point in the history
REST Spec PR 'Azure/azure-rest-api-specs#5451'
REST Spec PR Author 'AnatoliB'
REST Spec PR Last commit
  • Loading branch information
adxsdknet committed Mar 21, 2019
1 parent 3778856 commit fe56c73
Show file tree
Hide file tree
Showing 14 changed files with 1,226 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -88,5 +88,33 @@ public partial interface IResourceGraphClient : System.IDisposable
/// </param>
Task<AzureOperationResponse<QueryResponse>> ResourcesWithHttpMessagesAsync(QueryRequest query, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));

/// <summary>
/// List changes to a resource for a given time interval.
/// </summary>
/// <param name='parameters'>
/// the parameters for this request for changes.
/// </param>
/// <param name='customHeaders'>
/// The headers that will be added to request.
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
Task<AzureOperationResponse<ResourceChangeList>> ResourceChangesWithHttpMessagesAsync(ResourceChangesRequestParameters parameters, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));

/// <summary>
/// Get resource change details.
/// </summary>
/// <param name='parameters'>
/// The parameters for this request for resource change details.
/// </param>
/// <param name='customHeaders'>
/// The headers that will be added to request.
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
Task<AzureOperationResponse<ResourceChangeData>> ResourceChangeDetailsWithHttpMessagesAsync(ResourceChangeDetailsRequestParameters parameters, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));

}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
// <auto-generated>
// 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.
// </auto-generated>

namespace Microsoft.Azure.Management.ResourceGraph.Models
{
using Newtonsoft.Json;
using System.Linq;

/// <summary>
/// An interval in time specifying the date and time for the inclusive
/// start and exclusive end, i.e. `[start, end)`.
/// </summary>
public partial class DateTimeInterval
{
/// <summary>
/// Initializes a new instance of the DateTimeInterval class.
/// </summary>
public DateTimeInterval()
{
CustomInit();
}

/// <summary>
/// Initializes a new instance of the DateTimeInterval class.
/// </summary>
/// <param name="start">A datetime indicating the inclusive/closed
/// start of the time interval, i.e. `[`**`start`**`, end)`. Specifying
/// a `start` that occurs chronologically after `end` will result in an
/// error.</param>
/// <param name="end">A datetime indicating the exclusive/open end of
/// the time interval, i.e. `[start, `**`end`**`)`. Specifying an `end`
/// that occurs chronologically before `start` will result in an
/// error.</param>
public DateTimeInterval(System.DateTime start, System.DateTime end)
{
Start = start;
End = end;
CustomInit();
}

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

/// <summary>
/// Gets or sets a datetime indicating the inclusive/closed start of
/// the time interval, i.e. `[`**`start`**`, end)`. Specifying a
/// `start` that occurs chronologically after `end` will result in an
/// error.
/// </summary>
[JsonProperty(PropertyName = "start")]
public System.DateTime Start { get; set; }

/// <summary>
/// Gets or sets a datetime indicating the exclusive/open end of the
/// time interval, i.e. `[start, `**`end`**`)`. Specifying an `end`
/// that occurs chronologically before `start` will result in an error.
/// </summary>
[JsonProperty(PropertyName = "end")]
public System.DateTime End { get; set; }

/// <summary>
/// Validate the object.
/// </summary>
/// <exception cref="Rest.ValidationException">
/// Thrown if validation fails
/// </exception>
public virtual void Validate()
{
//Nothing to validate
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,20 @@ public FacetRequestOptions()
/// <summary>
/// Initializes a new instance of the FacetRequestOptions class.
/// </summary>
/// <param name="sortOrder">The sorting order by the hit count.
/// Possible values include: 'asc', 'desc'</param>
/// <param name="sortBy">The column name or query expression to sort
/// on. Defaults to count if not present.</param>
/// <param name="sortOrder">The sorting order by the selected column
/// (count by default). Possible values include: 'asc', 'desc'</param>
/// <param name="filter">Specifies the filter condition for the 'where'
/// clause which will be run on main query's result, just before the
/// actual faceting.</param>
/// <param name="top">The maximum number of facet rows that should be
/// returned.</param>
public FacetRequestOptions(FacetSortOrder? sortOrder = default(FacetSortOrder?), int? top = default(int?))
public FacetRequestOptions(string sortBy = default(string), FacetSortOrder? sortOrder = default(FacetSortOrder?), string filter = default(string), int? top = default(int?))
{
SortBy = sortBy;
SortOrder = sortOrder;
Filter = filter;
Top = top;
CustomInit();
}
Expand All @@ -47,12 +54,27 @@ public FacetRequestOptions()
partial void CustomInit();

/// <summary>
/// Gets or sets the sorting order by the hit count. Possible values
/// include: 'asc', 'desc'
/// Gets or sets the column name or query expression to sort on.
/// Defaults to count if not present.
/// </summary>
[JsonProperty(PropertyName = "sortBy")]
public string SortBy { get; set; }

/// <summary>
/// Gets or sets the sorting order by the selected column (count by
/// default). Possible values include: 'asc', 'desc'
/// </summary>
[JsonProperty(PropertyName = "sortOrder")]
public FacetSortOrder? SortOrder { get; set; }

/// <summary>
/// Gets or sets specifies the filter condition for the 'where' clause
/// which will be run on main query's result, just before the actual
/// faceting.
/// </summary>
[JsonProperty(PropertyName = "filter")]
public string Filter { get; set; }

/// <summary>
/// Gets or sets the maximum number of facet rows that should be
/// returned.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
// <auto-generated>
// 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.
// </auto-generated>

namespace Microsoft.Azure.Management.ResourceGraph.Models
{
using Microsoft.Rest;
using Newtonsoft.Json;
using System.Linq;

/// <summary>
/// Data on a specific change, represented by a pair of before and after
/// resource snapshots.
/// </summary>
public partial class ResourceChangeData
{
/// <summary>
/// Initializes a new instance of the ResourceChangeData class.
/// </summary>
public ResourceChangeData()
{
CustomInit();
}

/// <summary>
/// Initializes a new instance of the ResourceChangeData class.
/// </summary>
/// <param name="changeId">The change ID. Valid and unique within the
/// specified resource only.</param>
/// <param name="beforeSnapshot">The snapshot before the
/// change.</param>
/// <param name="afterSnapshot">The snapshot after the change.</param>
public ResourceChangeData(string changeId, ResourceChangeDataBeforeSnapshot beforeSnapshot, ResourceChangeDataAfterSnapshot afterSnapshot)
{
ChangeId = changeId;
BeforeSnapshot = beforeSnapshot;
AfterSnapshot = afterSnapshot;
CustomInit();
}

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

/// <summary>
/// Gets or sets the change ID. Valid and unique within the specified
/// resource only.
/// </summary>
[JsonProperty(PropertyName = "changeId")]
public string ChangeId { get; set; }

/// <summary>
/// Gets or sets the snapshot before the change.
/// </summary>
[JsonProperty(PropertyName = "beforeSnapshot")]
public ResourceChangeDataBeforeSnapshot BeforeSnapshot { get; set; }

/// <summary>
/// Gets or sets the snapshot after the change.
/// </summary>
[JsonProperty(PropertyName = "afterSnapshot")]
public ResourceChangeDataAfterSnapshot AfterSnapshot { get; set; }

/// <summary>
/// Validate the object.
/// </summary>
/// <exception cref="ValidationException">
/// Thrown if validation fails
/// </exception>
public virtual void Validate()
{
if (ChangeId == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "ChangeId");
}
if (BeforeSnapshot == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "BeforeSnapshot");
}
if (AfterSnapshot == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "AfterSnapshot");
}
if (BeforeSnapshot != null)
{
BeforeSnapshot.Validate();
}
if (AfterSnapshot != null)
{
AfterSnapshot.Validate();
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
// <auto-generated>
// 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.
// </auto-generated>

namespace Microsoft.Azure.Management.ResourceGraph.Models
{
using System.Linq;

/// <summary>
/// The snapshot after the change.
/// </summary>
public partial class ResourceChangeDataAfterSnapshot : ResourceSnapshotData
{
/// <summary>
/// Initializes a new instance of the ResourceChangeDataAfterSnapshot
/// class.
/// </summary>
public ResourceChangeDataAfterSnapshot()
{
CustomInit();
}

/// <summary>
/// Initializes a new instance of the ResourceChangeDataAfterSnapshot
/// class.
/// </summary>
/// <param name="timestamp">The time when the snapshot was created.
/// The snapshot timestamp provides an approximation as to when a
/// modification to a resource was detected. There can be a difference
/// between the actual modification time and the detection time. This
/// is due to differences in how operations that modify a resource are
/// processed, versus how operation that record resource snapshots are
/// processed.</param>
/// <param name="content">The resource snapshot content (in
/// resourceChangeDetails response only).</param>
public ResourceChangeDataAfterSnapshot(System.DateTime timestamp, object content = default(object))
: base(timestamp, content)
{
CustomInit();
}

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

/// <summary>
/// Validate the object.
/// </summary>
/// <exception cref="Rest.ValidationException">
/// Thrown if validation fails
/// </exception>
public override void Validate()
{
base.Validate();
}
}
}
Loading

0 comments on commit fe56c73

Please sign in to comment.