/// <summary>
 /// Create role assignment.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.Azure.Management.Authorization.IRoleAssignmentOperations.
 /// </param>
 /// <param name='scope'>
 /// Required. Scope.
 /// </param>
 /// <param name='roleAssignmentName'>
 /// Required. Role assignment name.
 /// </param>
 /// <param name='parameters'>
 /// Required. Role assignment.
 /// </param>
 /// <returns>
 /// Role assignments creation results
 /// </returns>
 public static RoleAssignmentCreateResult Create(this IRoleAssignmentOperations operations, string scope, Guid roleAssignmentName, RoleAssignmentCreateParameters parameters)
 {
     return(Task.Factory.StartNew((object s) =>
     {
         return ((IRoleAssignmentOperations)s).CreateAsync(scope, roleAssignmentName, parameters);
     }
                                  , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
 /// <summary>
 /// Gets role assignments of the subscription.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.Azure.Management.Authorization.IRoleAssignmentOperations.
 /// </param>
 /// <param name='nextLink'>
 /// Required. NextLink from the previous successful call to List
 /// operation.
 /// </param>
 /// <returns>
 /// Role assignment list operation result.
 /// </returns>
 public static RoleAssignmentListResult ListNext(this IRoleAssignmentOperations operations, string nextLink)
 {
     return(Task.Factory.StartNew((object s) =>
     {
         return ((IRoleAssignmentOperations)s).ListNextAsync(nextLink);
     }
                                  , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
 /// <summary>
 /// Gets role assignments of the scope.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.Azure.Management.Authorization.IRoleAssignmentOperations.
 /// </param>
 /// <param name='scope'>
 /// Required. Scope.
 /// </param>
 /// <param name='parameters'>
 /// Optional. List operation filters. If null will return all role
 /// assignments at, above or below the subscription.
 /// </param>
 /// <returns>
 /// Role assignment list operation result.
 /// </returns>
 public static RoleAssignmentListResult ListForScope(this IRoleAssignmentOperations operations, string scope, ListAssignmentsFilterParameters parameters)
 {
     return(Task.Factory.StartNew((object s) =>
     {
         return ((IRoleAssignmentOperations)s).ListForScopeAsync(scope, parameters);
     }
                                  , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
 /// <summary>
 /// Delete role assignment.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.Azure.Management.Authorization.IRoleAssignmentOperations.
 /// </param>
 /// <param name='roleAssignmentId'>
 /// Required. Role assignment Id
 /// </param>
 /// <returns>
 /// Role assignments delete result
 /// </returns>
 public static RoleAssignmentDeleteResult DeleteById(this IRoleAssignmentOperations operations, string roleAssignmentId)
 {
     return(Task.Factory.StartNew((object s) =>
     {
         return ((IRoleAssignmentOperations)s).DeleteByIdAsync(roleAssignmentId);
     }
                                  , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
コード例 #5
0
 /// <summary>
 /// Initializes a new instance of the AuthorizationManagementClient
 /// class.
 /// </summary>
 /// <param name='httpClient'>
 /// The Http client
 /// </param>
 private AuthorizationManagementClient(HttpClient httpClient)
     : base(httpClient)
 {
     this._permissions     = new PermissionOperations(this);
     this._roleAssignments = new RoleAssignmentOperations(this);
     this._roleDefinitions = new RoleDefinitionOperations(this);
     this._apiVersion      = "2014-07-01-preview";
     this._longRunningOperationInitialTimeout = -1;
     this._longRunningOperationRetryTimeout   = -1;
     this.HttpClient.Timeout = TimeSpan.FromSeconds(300);
 }
コード例 #6
0
 /// <summary>
 /// Initializes a new instance of the AuthorizationManagementClient
 /// class.
 /// </summary>
 /// <param name='httpClient'>
 /// The Http client
 /// </param>
 public AuthorizationManagementClient(HttpClient httpClient)
     : base(httpClient)
 {
     this._classicAdministrators = new ClassicAdministratorOperations(this);
     this._permissions           = new PermissionOperations(this);
     this._roleAssignments       = new RoleAssignmentOperations(this);
     this._roleDefinitions       = new RoleDefinitionOperations(this);
     this._apiVersion            = APIVersion;
     this._longRunningOperationInitialTimeout = -1;
     this._longRunningOperationRetryTimeout   = -1;
     this.HttpClient.Timeout = TimeSpan.FromSeconds(300);
 }
 /// <summary>
 /// Create role assignment.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.Azure.Management.Authorization.IRoleAssignmentOperations.
 /// </param>
 /// <param name='scope'>
 /// Required. Scope.
 /// </param>
 /// <param name='roleAssignmentName'>
 /// Required. Role assignment name.
 /// </param>
 /// <param name='parameters'>
 /// Required. Role assignment.
 /// </param>
 /// <returns>
 /// Role assignments creation results
 /// </returns>
 public static Task <RoleAssignmentCreateResult> CreateAsync(this IRoleAssignmentOperations operations, string scope, Guid roleAssignmentName, RoleAssignmentCreateParameters parameters)
 {
     return(operations.CreateAsync(scope, roleAssignmentName, parameters, CancellationToken.None));
 }
 /// <summary>
 /// Gets role assignments of the subscription.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.Azure.Management.Authorization.IRoleAssignmentOperations.
 /// </param>
 /// <param name='nextLink'>
 /// Required. NextLink from the previous successful call to List
 /// operation.
 /// </param>
 /// <returns>
 /// Role assignment list operation result.
 /// </returns>
 public static Task <RoleAssignmentListResult> ListNextAsync(this IRoleAssignmentOperations operations, string nextLink)
 {
     return(operations.ListNextAsync(nextLink, CancellationToken.None));
 }
 /// <summary>
 /// Gets role assignments of the scope.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.Azure.Management.Authorization.IRoleAssignmentOperations.
 /// </param>
 /// <param name='scope'>
 /// Required. Scope.
 /// </param>
 /// <param name='parameters'>
 /// Optional. List operation filters. If null will return all role
 /// assignments at, above or below the subscription.
 /// </param>
 /// <returns>
 /// Role assignment list operation result.
 /// </returns>
 public static Task <RoleAssignmentListResult> ListForScopeAsync(this IRoleAssignmentOperations operations, string scope, ListAssignmentsFilterParameters parameters)
 {
     return(operations.ListForScopeAsync(scope, parameters, CancellationToken.None));
 }
 /// <summary>
 /// Gets role assignments of the resource.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.Azure.Management.Authorization.IRoleAssignmentOperations.
 /// </param>
 /// <param name='resourceGroupName'>
 /// Required. The name of the resource group.
 /// </param>
 /// <param name='identity'>
 /// Required. Resource identity.
 /// </param>
 /// <param name='parameters'>
 /// Optional. List operation filters. If null will return all role
 /// assignments at, above or below the resource.
 /// </param>
 /// <returns>
 /// Role assignment list operation result.
 /// </returns>
 public static Task <RoleAssignmentListResult> ListForResourceAsync(this IRoleAssignmentOperations operations, string resourceGroupName, ResourceIdentity identity, ListAssignmentsFilterParameters parameters)
 {
     return(operations.ListForResourceAsync(resourceGroupName, identity, parameters, CancellationToken.None));
 }
 /// <summary>
 /// Get single role assignment.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.Azure.Management.Authorization.IRoleAssignmentOperations.
 /// </param>
 /// <param name='roleAssignmentId'>
 /// Required. Role assignment Id
 /// </param>
 /// <returns>
 /// Role assignment get operation result.
 /// </returns>
 public static Task <RoleAssignmentGetResult> GetByIdAsync(this IRoleAssignmentOperations operations, string roleAssignmentId)
 {
     return(operations.GetByIdAsync(roleAssignmentId, CancellationToken.None));
 }
 /// <summary>
 /// Get single role assignment.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.Azure.Management.Authorization.IRoleAssignmentOperations.
 /// </param>
 /// <param name='scope'>
 /// Required. Scope.
 /// </param>
 /// <param name='roleAssignmentName'>
 /// Required. Role assignment name.
 /// </param>
 /// <returns>
 /// Role assignment get operation result.
 /// </returns>
 public static Task <RoleAssignmentGetResult> GetAsync(this IRoleAssignmentOperations operations, string scope, Guid roleAssignmentName)
 {
     return(operations.GetAsync(scope, roleAssignmentName, CancellationToken.None));
 }
 /// <summary>
 /// Create role assignment by Id.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.Azure.Management.Authorization.IRoleAssignmentOperations.
 /// </param>
 /// <param name='roleAssignmentId'>
 /// Required. Role assignment Id
 /// </param>
 /// <param name='parameters'>
 /// Required. Role assignment.
 /// </param>
 /// <returns>
 /// Role assignments creation results
 /// </returns>
 public static Task <RoleAssignmentCreateResult> CreateByIdAsync(this IRoleAssignmentOperations operations, string roleAssignmentId, RoleAssignmentCreateParameters parameters)
 {
     return(operations.CreateByIdAsync(roleAssignmentId, parameters, CancellationToken.None));
 }
コード例 #14
0
 /// <summary>
 /// Delete role assignment.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.Azure.Management.Authorization.IRoleAssignmentOperations.
 /// </param>
 /// <param name='roleAssignmentId'>
 /// Required. Role assignment Id
 /// </param>
 /// <returns>
 /// A standard service response including an HTTP status code and
 /// request ID.
 /// </returns>
 public static Task <OperationResponse> DeleteByIdAsync(this IRoleAssignmentOperations operations, string roleAssignmentId)
 {
     return(operations.DeleteByIdAsync(roleAssignmentId, CancellationToken.None));
 }
コード例 #15
0
 /// <summary>
 /// Delete role assignment.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.Azure.Management.Authorization.IRoleAssignmentOperations.
 /// </param>
 /// <param name='scope'>
 /// Required. Scope.
 /// </param>
 /// <param name='roleAssignmentName'>
 /// Required. Role assignment name.
 /// </param>
 /// <returns>
 /// A standard service response including an HTTP status code and
 /// request ID.
 /// </returns>
 public static Task <OperationResponse> DeleteAsync(this IRoleAssignmentOperations operations, string scope, Guid roleAssignmentName)
 {
     return(operations.DeleteAsync(scope, roleAssignmentName, CancellationToken.None));
 }