/// <summary>
 /// Gets list of service principals for the current tenant.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.Azure.Graph.RBAC.IServicePrincipalOperations.
 /// </param>
 /// <param name='nextLink'>
 /// Required. NextLink from the previous successful call to List
 /// operation.
 /// </param>
 /// <returns>
 /// Server response for get tenant service principals API call
 /// </returns>
 public static ServicePrincipalListResult ListNext(this IServicePrincipalOperations operations, string nextLink)
 {
     return(Task.Factory.StartNew((object s) =>
     {
         return ((IServicePrincipalOperations)s).ListNextAsync(nextLink);
     }
                                  , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
 /// <summary>
 /// Deletes service principal from the directory.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.Azure.Graph.RBAC.IServicePrincipalOperations.
 /// </param>
 /// <param name='objectId'>
 /// Required. Object id to delete service principal information.
 /// </param>
 /// <returns>
 /// Server response for service principal information API call
 /// </returns>
 public static ServicePrincipalGetResult Delete(this IServicePrincipalOperations operations, string objectId)
 {
     return(Task.Factory.StartNew((object s) =>
     {
         return ((IServicePrincipalOperations)s).DeleteAsync(objectId);
     }
                                  , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
Exemplo n.º 3
0
 /// <summary>
 /// Initializes a new instance of the GraphRbacManagementClient class.
 /// </summary>
 /// <param name='httpClient'>
 /// The Http client
 /// </param>
 public GraphRbacManagementClient(HttpClient httpClient)
     : base(httpClient)
 {
     this._application      = new ApplicationOperations(this);
     this._group            = new GroupOperations(this);
     this._objects          = new ObjectOperations(this);
     this._servicePrincipal = new ServicePrincipalOperations(this);
     this._user             = new UserOperations(this);
     this._apiVersion       = "1.42-previewInternal";
     this._longRunningOperationInitialTimeout = -1;
     this._longRunningOperationRetryTimeout   = -1;
     this.HttpClient.Timeout = TimeSpan.FromSeconds(300);
 }
 /// <summary>
 /// Creates a service principal in the  directory.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.Azure.Graph.RBAC.IServicePrincipalOperations.
 /// </param>
 /// <param name='parameters'>
 /// Required. Parameters to create a service principal.
 /// </param>
 /// <returns>
 /// Server response for service principal information API call
 /// </returns>
 public static Task <ServicePrincipalGetResult> CreateAsync(this IServicePrincipalOperations operations, ServicePrincipalCreateParameters parameters)
 {
     return(operations.CreateAsync(parameters, CancellationToken.None));
 }
 /// <summary>
 /// Gets list of service principals for the current tenant.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.Azure.Graph.RBAC.IServicePrincipalOperations.
 /// </param>
 /// <param name='nextLink'>
 /// Required. NextLink from the previous successful call to List
 /// operation.
 /// </param>
 /// <returns>
 /// Server response for get tenant service principals API call
 /// </returns>
 public static Task <ServicePrincipalListResult> ListNextAsync(this IServicePrincipalOperations operations, string nextLink)
 {
     return(operations.ListNextAsync(nextLink, CancellationToken.None));
 }
 /// <summary>
 /// Gets list of service principals from the current tenant.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.Azure.Graph.RBAC.IServicePrincipalOperations.
 /// </param>
 /// <param name='displayNameStartsWith'>
 /// Optional. Display name to filter results.
 /// </param>
 /// <returns>
 /// Server response for get tenant service principals API call
 /// </returns>
 public static Task <ServicePrincipalListResult> ListAsync(this IServicePrincipalOperations operations, string displayNameStartsWith)
 {
     return(operations.ListAsync(displayNameStartsWith, CancellationToken.None));
 }
 /// <summary>
 /// Gets service principal information from the directory.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.Azure.Graph.RBAC.IServicePrincipalOperations.
 /// </param>
 /// <param name='servicePrincipalName'>
 /// Required. filter based on service principal name
 /// </param>
 /// <returns>
 /// Server response for get tenant service principals API call
 /// </returns>
 public static Task <ServicePrincipalListResult> GetByServicePrincipalNameAsync(this IServicePrincipalOperations operations, string servicePrincipalName)
 {
     return(operations.GetByServicePrincipalNameAsync(servicePrincipalName, CancellationToken.None));
 }
 /// <summary>
 /// Gets service principal information from the directory.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.Azure.Graph.RBAC.IServicePrincipalOperations.
 /// </param>
 /// <param name='objectId'>
 /// Required. Object id to get service principal information.
 /// </param>
 /// <returns>
 /// Server response for service principal information API call
 /// </returns>
 public static Task <ServicePrincipalGetResult> GetAsync(this IServicePrincipalOperations operations, string objectId)
 {
     return(operations.GetAsync(objectId, CancellationToken.None));
 }