public virtual Response AddOwner(string applicationObjectId, AddOwnerParameters parameters, CancellationToken cancellationToken = default) { using var scope = _clientDiagnostics.CreateScope("ApplicationsClient.AddOwner"); scope.Start(); try { return(RestClient.AddOwner(applicationObjectId, parameters, cancellationToken)); } catch (Exception e) { scope.Failed(e); throw; } }
public virtual async Task <Response> AddOwnerAsync(string objectId, AddOwnerParameters parameters, CancellationToken cancellationToken = default) { using var scope = _clientDiagnostics.CreateScope("ServicePrincipalsOperations.AddOwner"); scope.Start(); try { return(await RestClient.AddOwnerAsync(objectId, parameters, cancellationToken).ConfigureAwait(false)); } catch (Exception e) { scope.Failed(e); throw; } }
/// <summary> /// Add an owner to an application. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='applicationObjectId'> /// The object ID of the application to which to add the owner. /// </param> /// <param name='parameters'> /// The URL of the owner object, such as /// https://graph.windows.net/0b1f9851-1bf0-433f-aec3-cb9272f093dc/directoryObjects/f260bbc4-c254-447b-94cf-293b5ec434dd. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task AddOwnerAsync(this IApplicationsOperations operations, string applicationObjectId, AddOwnerParameters parameters, CancellationToken cancellationToken = default(CancellationToken)) { (await operations.AddOwnerWithHttpMessagesAsync(applicationObjectId, parameters, null, cancellationToken).ConfigureAwait(false)).Dispose(); }
/// <summary> /// Add an owner to an application. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='applicationObjectId'> /// The object ID of the application to which to add the owner. /// </param> /// <param name='parameters'> /// The URL of the owner object, such as /// https://graph.windows.net/0b1f9851-1bf0-433f-aec3-cb9272f093dc/directoryObjects/f260bbc4-c254-447b-94cf-293b5ec434dd. /// </param> public static void AddOwner(this IApplicationsOperations operations, string applicationObjectId, AddOwnerParameters parameters) { operations.AddOwnerAsync(applicationObjectId, parameters).GetAwaiter().GetResult(); }
/// <summary> /// Add an owner to a group. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='objectId'> /// The object ID of the application to which to add the owner. /// </param> /// <param name='parameters'> /// The URL of the owner object, such as /// https://graph.windows.net/0b1f9851-1bf0-433f-aec3-cb9272f093dc/directoryObjects/f260bbc4-c254-447b-94cf-293b5ec434dd. /// </param> public static void AddOwner(this IGroupsOperations operations, string objectId, AddOwnerParameters parameters) { operations.AddOwnerAsync(objectId, parameters).GetAwaiter().GetResult(); }