Skip to content

Commit

Permalink
.NET SDK Resource Provider:'SecurityCenter'
Browse files Browse the repository at this point in the history
REST Spec PR 'Azure/azure-rest-api-specs#5649'
REST Spec PR Author 'chlahav'
REST Spec PR Last commit
  • Loading branch information
adxsdknet committed May 12, 2019
1 parent 3a36eb3 commit 0914506
Show file tree
Hide file tree
Showing 13 changed files with 818 additions and 48 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!--This file and it's contents are updated at build time moving or editing might result in build failure. Take due deligence while editing this file-->
<PropertyGroup>
<AzureApiTag>Security_2017-08-01-preview;Security_2019-01-01;Security_2015-06-01-preview;Security_2019-01-01-preview;Security_2018-06-01;</AzureApiTag>
<AzureApiTag>Security_2017-08-01-preview;Security_2019-01-01;Security_2015-06-01-preview;Security_2019-01-01-preview;Security_2017-08-01;Security_2018-06-01;</AzureApiTag>
<PackageTags>$(PackageTags);$(CommonTags);$(AzureApiTag);</PackageTags>
</PropertyGroup>
</Project>

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
// <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.Security
{
using Microsoft.Rest;
using Microsoft.Rest.Azure;
using Models;
using System.Threading;
using System.Threading.Tasks;

/// <summary>
/// Extension methods for ComplianceResultsOperations.
/// </summary>
public static partial class ComplianceResultsOperationsExtensions
{
/// <summary>
/// Security compliance results in the subscription
/// </summary>
/// <param name='operations'>
/// The operations group for this extension method.
/// </param>
/// <param name='scope'>
/// Scope of the query, can be subscription
/// (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management group
/// (/providers/Microsoft.Management/managementGroups/mgName).
/// </param>
public static ComplianceResultList List(this IComplianceResultsOperations operations, string scope)
{
return operations.ListAsync(scope).GetAwaiter().GetResult();
}

/// <summary>
/// Security compliance results in the subscription
/// </summary>
/// <param name='operations'>
/// The operations group for this extension method.
/// </param>
/// <param name='scope'>
/// Scope of the query, can be subscription
/// (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management group
/// (/providers/Microsoft.Management/managementGroups/mgName).
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
public static async Task<ComplianceResultList> ListAsync(this IComplianceResultsOperations operations, string scope, CancellationToken cancellationToken = default(CancellationToken))
{
using (var _result = await operations.ListWithHttpMessagesAsync(scope, null, cancellationToken).ConfigureAwait(false))
{
return _result.Body;
}
}

/// <summary>
/// Security Compliance Result
/// </summary>
/// <param name='operations'>
/// The operations group for this extension method.
/// </param>
/// <param name='resourceId'>
/// The identifier of the resource.
/// </param>
/// <param name='complianceResultName'>
/// name of the desired assessment compliance result
/// </param>
public static ComplianceResult Get(this IComplianceResultsOperations operations, string resourceId, string complianceResultName)
{
return operations.GetAsync(resourceId, complianceResultName).GetAwaiter().GetResult();
}

/// <summary>
/// Security Compliance Result
/// </summary>
/// <param name='operations'>
/// The operations group for this extension method.
/// </param>
/// <param name='resourceId'>
/// The identifier of the resource.
/// </param>
/// <param name='complianceResultName'>
/// name of the desired assessment compliance result
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
public static async Task<ComplianceResult> GetAsync(this IComplianceResultsOperations operations, string resourceId, string complianceResultName, CancellationToken cancellationToken = default(CancellationToken))
{
using (var _result = await operations.GetWithHttpMessagesAsync(resourceId, complianceResultName, null, cancellationToken).ConfigureAwait(false))
{
return _result.Body;
}
}

}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
// <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.Security
{
using Microsoft.Rest;
using Microsoft.Rest.Azure;
using Models;
using System.Collections;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;

/// <summary>
/// ComplianceResultsOperations operations.
/// </summary>
public partial interface IComplianceResultsOperations
{
/// <summary>
/// Security compliance results in the subscription
/// </summary>
/// <param name='scope'>
/// Scope of the query, can be subscription
/// (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management
/// group (/providers/Microsoft.Management/managementGroups/mgName).
/// </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>
/// <exception cref="Microsoft.Rest.ValidationException">
/// Thrown when a required parameter is null
/// </exception>
Task<AzureOperationResponse<ComplianceResultList>> ListWithHttpMessagesAsync(string scope, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
/// <summary>
/// Security Compliance Result
/// </summary>
/// <param name='resourceId'>
/// The identifier of the resource.
/// </param>
/// <param name='complianceResultName'>
/// name of the desired assessment compliance result
/// </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>
/// <exception cref="Microsoft.Rest.ValidationException">
/// Thrown when a required parameter is null
/// </exception>
Task<AzureOperationResponse<ComplianceResult>> GetWithHttpMessagesAsync(string resourceId, string complianceResultName, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,11 @@ public partial interface ISecurityCenterClient : System.IDisposable
bool? GenerateClientRequestId { get; set; }


/// <summary>
/// Gets the IComplianceResultsOperations.
/// </summary>
IComplianceResultsOperations ComplianceResults { get; }

/// <summary>
/// Gets the IPricingsOperations.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
// <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.Security.Models
{
using Newtonsoft.Json;
using System.Linq;

/// <summary>
/// The result of the assessment
/// </summary>
public partial class AssessmentStatus
{
/// <summary>
/// Initializes a new instance of the AssessmentStatus class.
/// </summary>
public AssessmentStatus()
{
CustomInit();
}

/// <summary>
/// Initializes a new instance of the AssessmentStatus class.
/// </summary>
/// <param name="code">Programmatic code for the status of the
/// assessment. Possible values include: 'Healthy', 'Unhealthy',
/// 'NotApplicable'</param>
/// <param name="cause">Programmatic code for the cause of the
/// assessment status</param>
/// <param name="description">Human readable description of the
/// assessment status</param>
public AssessmentStatus(string code = default(string), string cause = default(string), string description = default(string))
{
Code = code;
Cause = cause;
Description = description;
CustomInit();
}

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

/// <summary>
/// Gets programmatic code for the status of the assessment. Possible
/// values include: 'Healthy', 'Unhealthy', 'NotApplicable'
/// </summary>
[JsonProperty(PropertyName = "code")]
public string Code { get; private set; }

/// <summary>
/// Gets programmatic code for the cause of the assessment status
/// </summary>
[JsonProperty(PropertyName = "cause")]
public string Cause { get; private set; }

/// <summary>
/// Gets human readable description of the assessment status
/// </summary>
[JsonProperty(PropertyName = "description")]
public string Description { get; private set; }

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,18 @@ namespace Microsoft.Azure.Management.Security.Models
{

/// <summary>
/// Defines values for Severity.
/// Defines values for AssessmentStatusCode.
/// </summary>
public static class Severity
public static class AssessmentStatusCode
{
/// <summary>
/// The resource is healthy
/// </summary>
public const string Passed = "Passed";
public const string Healthy = "Healthy";
/// <summary>
/// The resource has a security issue that needs to be addressed
/// </summary>
public const string Failed = "Failed";
public const string Unhealthy = "Unhealthy";
/// <summary>
/// Assessment for this resource did not happen
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
// <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.Security.Models
{
using Microsoft.Rest;
using Microsoft.Rest.Serialization;
using Newtonsoft.Json;
using System.Linq;

/// <summary>
/// a compliance result
/// </summary>
[Rest.Serialization.JsonTransformation]
public partial class ComplianceResult : Resource
{
/// <summary>
/// Initializes a new instance of the ComplianceResult class.
/// </summary>
public ComplianceResult()
{
CustomInit();
}

/// <summary>
/// Initializes a new instance of the ComplianceResult class.
/// </summary>
/// <param name="id">Resource Id</param>
/// <param name="name">Resource name</param>
/// <param name="type">Resource type</param>
/// <param name="resourceStatus">The status of the resource regarding a
/// single assessment. Possible values include: 'Healthy',
/// 'NotApplicable', 'OffByPolicy', 'NotHealthy'</param>
public ComplianceResult(string id = default(string), string name = default(string), string type = default(string), string resourceStatus = default(string))
: base(id, name, type)
{
ResourceStatus = resourceStatus;
CustomInit();
}

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

/// <summary>
/// Gets the status of the resource regarding a single assessment.
/// Possible values include: 'Healthy', 'NotApplicable', 'OffByPolicy',
/// 'NotHealthy'
/// </summary>
[JsonProperty(PropertyName = "properties.resourceStatus")]
public string ResourceStatus { get; private set; }

}
}
Loading

0 comments on commit 0914506

Please sign in to comment.