Skip to content

Commit

Permalink
.NET SDK Resource Provider:'Graph.RBAC'
Browse files Browse the repository at this point in the history
REST Spec PR 'Azure/azure-rest-api-specs#5417'
REST Spec PR Author 'ankushbindlish2'
REST Spec PR Last commit
  • Loading branch information
adxsdknet committed Mar 20, 2019
1 parent fe96af8 commit 44d2531
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2198,6 +2198,9 @@ internal ApplicationsOperations(GraphRbacManagementClient client)
/// <summary>
/// Gets an object id for a given application id from the current tenant.
/// </summary>
/// <param name='applicationID'>
/// The application ID.
/// </param>
/// <param name='customHeaders'>
/// Headers that will be added to request.
/// </param>
Expand All @@ -2219,7 +2222,7 @@ internal ApplicationsOperations(GraphRbacManagementClient client)
/// <return>
/// A response object containing the response body and response headers.
/// </return>
public async Task<AzureOperationResponse<ServicePrincipalObjectResult>> GetServicePrincipalsIdByAppIdWithHttpMessagesAsync(Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
public async Task<AzureOperationResponse<ServicePrincipalObjectResult>> GetServicePrincipalsIdByAppIdWithHttpMessagesAsync(string applicationID, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (Client.ApiVersion == null)
{
Expand All @@ -2229,9 +2232,9 @@ internal ApplicationsOperations(GraphRbacManagementClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.TenantID");
}
if (Client.ApplicationID == null)
if (applicationID == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApplicationID");
throw new ValidationException(ValidationRules.CannotBeNull, "applicationID");
}
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
Expand All @@ -2240,14 +2243,15 @@ internal ApplicationsOperations(GraphRbacManagementClient client)
{
_invocationId = ServiceClientTracing.NextInvocationId.ToString();
Dictionary<string, object> tracingParameters = new Dictionary<string, object>();
tracingParameters.Add("applicationID", applicationID);
tracingParameters.Add("cancellationToken", cancellationToken);
ServiceClientTracing.Enter(_invocationId, this, "GetServicePrincipalsIdByAppId", tracingParameters);
}
// Construct URL
var _baseUrl = Client.BaseUri.AbsoluteUri;
var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "{tenantID}/servicePrincipalsByAppId/{applicationID}/objectId").ToString();
_url = _url.Replace("{tenantID}", System.Uri.EscapeDataString(Client.TenantID));
_url = _url.Replace("{applicationID}", System.Uri.EscapeDataString(Client.ApplicationID));
_url = _url.Replace("{applicationID}", System.Uri.EscapeDataString(applicationID));
List<string> _queryParameters = new List<string>();
if (Client.ApiVersion != null)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -460,9 +460,12 @@ public static void UpdatePasswordCredentials(this IApplicationsOperations operat
/// <param name='operations'>
/// The operations group for this extension method.
/// </param>
public static ServicePrincipalObjectResult GetServicePrincipalsIdByAppId(this IApplicationsOperations operations)
/// <param name='applicationID'>
/// The application ID.
/// </param>
public static ServicePrincipalObjectResult GetServicePrincipalsIdByAppId(this IApplicationsOperations operations, string applicationID)
{
return operations.GetServicePrincipalsIdByAppIdAsync().GetAwaiter().GetResult();
return operations.GetServicePrincipalsIdByAppIdAsync(applicationID).GetAwaiter().GetResult();
}

/// <summary>
Expand All @@ -471,12 +474,15 @@ public static ServicePrincipalObjectResult GetServicePrincipalsIdByAppId(this IA
/// <param name='operations'>
/// The operations group for this extension method.
/// </param>
/// <param name='applicationID'>
/// The application ID.
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
public static async Task<ServicePrincipalObjectResult> GetServicePrincipalsIdByAppIdAsync(this IApplicationsOperations operations, CancellationToken cancellationToken = default(CancellationToken))
public static async Task<ServicePrincipalObjectResult> GetServicePrincipalsIdByAppIdAsync(this IApplicationsOperations operations, string applicationID, CancellationToken cancellationToken = default(CancellationToken))
{
using (var _result = await operations.GetServicePrincipalsIdByAppIdWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false))
using (var _result = await operations.GetServicePrincipalsIdByAppIdWithHttpMessagesAsync(applicationID, null, cancellationToken).ConfigureAwait(false))
{
return _result.Body;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,6 @@ public partial class GraphRbacManagementClient : ServiceClient<GraphRbacManageme
/// </summary>
public string TenantID { get; set; }

/// <summary>
/// The application ID.
/// </summary>
public string ApplicationID { get; set; }

/// <summary>
/// The preferred language for the response.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,9 @@ public partial interface IApplicationsOperations
/// Gets an object id for a given application id from the current
/// tenant.
/// </summary>
/// <param name='applicationID'>
/// The application ID.
/// </param>
/// <param name='customHeaders'>
/// The headers that will be added to request.
/// </param>
Expand All @@ -310,7 +313,7 @@ public partial interface IApplicationsOperations
/// <exception cref="Microsoft.Rest.ValidationException">
/// Thrown when a required parameter is null
/// </exception>
Task<AzureOperationResponse<ServicePrincipalObjectResult>> GetServicePrincipalsIdByAppIdWithHttpMessagesAsync(Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
Task<AzureOperationResponse<ServicePrincipalObjectResult>> GetServicePrincipalsIdByAppIdWithHttpMessagesAsync(string applicationID, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
/// <summary>
/// Gets a list of applications from the current tenant.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,6 @@ public partial interface IGraphRbacManagementClient : System.IDisposable
/// </summary>
string TenantID { get; set; }

/// <summary>
/// The application ID.
/// </summary>
string ApplicationID { get; set; }

/// <summary>
/// The preferred language for the response.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
namespace Microsoft.Azure.Graph.RBAC.Models
{
using Newtonsoft.Json;
using System.Collections;
using System.Collections.Generic;
using System.Linq;

/// <summary>
Expand All @@ -33,10 +31,11 @@ public ServicePrincipalObjectResult()
/// Initializes a new instance of the ServicePrincipalObjectResult
/// class.
/// </summary>
/// <param name="value">A collection of Application Objects.</param>
/// <param name="value">The Object ID of the service principal with the
/// specified application ID.</param>
/// <param name="odatametadata">The URL representing edm
/// equivalent.</param>
public ServicePrincipalObjectResult(IList<string> value = default(IList<string>), string odatametadata = default(string))
public ServicePrincipalObjectResult(string value = default(string), string odatametadata = default(string))
{
Value = value;
Odatametadata = odatametadata;
Expand All @@ -49,10 +48,11 @@ public ServicePrincipalObjectResult()
partial void CustomInit();

/// <summary>
/// Gets or sets a collection of Application Objects.
/// Gets or sets the Object ID of the service principal with the
/// specified application ID.
/// </summary>
[JsonProperty(PropertyName = "value")]
public IList<string> Value { get; set; }
public string Value { get; set; }

/// <summary>
/// Gets or sets the URL representing edm equivalent.
Expand Down

0 comments on commit 44d2531

Please sign in to comment.