예제 #1
0
 /// <summary>
 /// Get entities from groups
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='consistencyLevel'>
 /// Indicates the requested consistency level. Documentation URL:
 /// https://developer.microsoft.com/en-us/office/blogs/microsoft-graph-advanced-queries-for-directory-objects-are-now-generally-available/
 /// </param>
 /// <param name='top'>
 /// Show only the first n items
 /// </param>
 /// <param name='skip'>
 /// Skip the first n items
 /// </param>
 /// <param name='search'>
 /// Search items by search phrases
 /// </param>
 /// <param name='filter'>
 /// Filter items by property values
 /// </param>
 /// <param name='count'>
 /// Include count of items
 /// </param>
 /// <param name='orderby'>
 /// Order items by property values
 /// </param>
 /// <param name='select'>
 /// Select properties to be returned
 /// </param>
 /// <param name='expand'>
 /// Expand related entities
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <ListGroupOKResponse> ListGroupAsync(this IGroupsOperations operations, string consistencyLevel = default(string), int?top = default(int?), int?skip = default(int?), string search = default(string), string filter = default(string), bool?count = default(bool?), IList <string> orderby = default(IList <string>), IList <string> select = default(IList <string>), IList <string> expand = default(IList <string>), CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.ListGroupWithHttpMessagesAsync(consistencyLevel, top, skip, search, filter, count, orderby, select, expand, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
 /// <summary>
 /// Creates new workspace.
 /// </summary>
 /// <remarks>
 /// &lt;br/&gt;**Required scope**: Workspace.ReadWrite.All&lt;br/&gt;To set the
 /// permissions scope, see [Register an
 /// app](https://docs.microsoft.com/power-bi/developer/register-app).
 /// </remarks>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='requestParameters'>
 /// Create group request parameters
 /// </param>
 /// <param name='workspaceV2'>
 /// Preview feature: Create a workspace V2. The only supported value is true.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <Group> CreateGroupAsync(this IGroupsOperations operations, GroupCreationRequest requestParameters, bool?workspaceV2 = default(bool?), CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.CreateGroupWithHttpMessagesAsync(requestParameters, workspaceV2, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
예제 #3
0
 /// <summary>
 /// Add new entity to groups
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='body'>
 /// New entity
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <MicrosoftGraphGroup> CreateGroupAsync(this IGroupsOperations operations, MicrosoftGraphGroup body, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.CreateGroupWithHttpMessagesAsync(body, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
 /// <summary>
 /// Directory objects that are owners of the group.
 /// </summary>
 /// <remarks>
 /// The owners are a set of non-admin users who are allowed to modify this
 /// object.
 /// </remarks>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='objectId'>
 /// The object ID of the group for which to get owners.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <IPage <DirectoryObject> > ListOwnersAsync(this IGroupsOperations operations, string objectId, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.ListOwnersWithHttpMessagesAsync(objectId, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
 /// <summary>
 /// Checks whether the specified user, group, contact, or service principal is
 /// a direct or transitive member of the specified group.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='parameters'>
 /// The check group membership parameters.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <CheckGroupMembershipResult> IsMemberOfAsync(this IGroupsOperations operations, CheckGroupMembershipParameters parameters, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.IsMemberOfWithHttpMessagesAsync(parameters, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
예제 #6
0
 /// <summary>
 /// Get entity from groups by key
 /// </summary>
 /// <remarks>
 /// Represents an Azure Active Directory object. The directoryObject type is
 /// the base type for many other directory entity types.
 /// </remarks>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='groupId'>
 /// key: id of group
 /// </param>
 /// <param name='consistencyLevel'>
 /// Indicates the requested consistency level. Documentation URL:
 /// https://developer.microsoft.com/en-us/office/blogs/microsoft-graph-advanced-queries-for-directory-objects-are-now-generally-available/
 /// </param>
 /// <param name='select'>
 /// Select properties to be returned
 /// </param>
 /// <param name='expand'>
 /// Expand related entities
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <MicrosoftGraphGroup> GetGroupAsync(this IGroupsOperations operations, string groupId, string consistencyLevel = default(string), IList <string> select = default(IList <string>), IList <string> expand = default(IList <string>), CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.GetGroupWithHttpMessagesAsync(groupId, consistencyLevel, select, expand, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
 /// <summary>
 /// Gets a collection of object IDs of groups of which the specified group is a
 /// member.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='objectId'>
 /// The object ID of the group for which to get group membership.
 /// </param>
 /// <param name='parameters'>
 /// Group filtering parameters.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <IEnumerable <string> > GetMemberGroupsAsync(this IGroupsOperations operations, string objectId, GroupGetMemberGroupsParameters parameters, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.GetMemberGroupsWithHttpMessagesAsync(objectId, parameters, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
 /// <summary>
 /// Gets the members of a group.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='nextLink'>
 /// Next link for the list operation.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <IPage <AADObject> > GetGroupMembersNextAsync(this IGroupsOperations operations, string nextLink, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.GetGroupMembersNextWithHttpMessagesAsync(nextLink, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
 /// <summary>
 /// Gets list of groups for the current tenant.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='odataQuery'>
 /// OData parameters to apply to the operation.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <IPage <ADGroup> > ListAsync(this IGroupsOperations operations, ODataQuery <ADGroup> odataQuery = default(ODataQuery <ADGroup>), CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.ListWithHttpMessagesAsync(odataQuery, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
 /// <summary>
 /// Gets group information from the directory.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='objectId'>
 /// The object ID of the user for which to get group information.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <ADGroup> GetAsync(this IGroupsOperations operations, string objectId, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.GetWithHttpMessagesAsync(objectId, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
예제 #11
0
 /// <summary>
 /// Initializes a new instance of the ApiManagementClient class.
 /// </summary>
 /// <param name='httpClient'>
 /// The Http client
 /// </param>
 public ApiManagementClient(HttpClient httpClient)
     : base(httpClient)
 {
     this._apiOperationPolicy = new ApiOperationPolicyOperations(this);
     this._apiOperations      = new ApiOperationsOperations(this);
     this._apiPolicy          = new ApiPolicyOperations(this);
     this._apiProducts        = new ApiProductsOperations(this);
     this._apis = new ApisOperations(this);
     this._authorizationServers = new AuthorizationServersOperations(this);
     this._certificates         = new CertificatesOperations(this);
     this._groups               = new GroupsOperations(this);
     this._groupUsers           = new GroupUsersOperations(this);
     this._policySnippents      = new PolicySnippetsOperations(this);
     this._productApis          = new ProductApisOperations(this);
     this._productGroups        = new ProductGroupsOperations(this);
     this._productPolicy        = new ProductPolicyOperations(this);
     this._products             = new ProductsOperations(this);
     this._productSubscriptions = new ProductSubscriptionsOperations(this);
     this._regions              = new RegionsOperations(this);
     this._reports              = new ReportsOperations(this);
     this._resourceProvider     = new ResourceProviderOperations(this);
     this._subscriptions        = new SubscriptionsOperations(this);
     this._tenantPolicy         = new TenantPolicyOperations(this);
     this._userApplications     = new UserApplicationsOperations(this);
     this._userGroups           = new UserGroupsOperations(this);
     this._userIdentities       = new UserIdentitiesOperations(this);
     this._users      = new UsersOperations(this);
     this._apiVersion = "2014-02-14";
     this._longRunningOperationInitialTimeout = -1;
     this._longRunningOperationRetryTimeout   = -1;
     this.HttpClient.Timeout = TimeSpan.FromSeconds(300);
 }
 /// <summary>
 /// Create a group in the directory.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='parameters'>
 /// The parameters for the group to create.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <ADGroup> CreateAsync(this IGroupsOperations operations, GroupCreateParameters parameters, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.CreateWithHttpMessagesAsync(parameters, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
 /// <summary>
 /// Returns a list of workspaces the user has access to.
 /// </summary>
 /// <remarks>
 /// &lt;br/&gt;**Note**: Users that have been recently added to a group may not
 /// have their new group immediately available, see [Refresh user
 /// permissions](https://docs.microsoft.com/en-us/rest/api/power-bi/users/refreshuserpermissions).&lt;br/&gt;&lt;br/&gt;**Required
 /// scope**: Workspace.Read.All or Workspace.ReadWrite.All&lt;br/&gt;To set the
 /// permissions scope, see [Register an
 /// app](https://docs.microsoft.com/power-bi/developer/register-app).
 /// </remarks>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='filter'>
 /// Filters the results, based on a boolean condition
 /// </param>
 /// <param name='top'>
 /// Returns only the first n results
 /// </param>
 /// <param name='skip'>
 /// Skips the first n results
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <Groups> GetGroupsAsync(this IGroupsOperations operations, string filter = default(string), int?top = default(int?), int?skip = default(int?), CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.GetGroupsWithHttpMessagesAsync(filter, top, skip, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
 /// <summary>
 /// Returns a list of users that have access to the specified workspace.
 /// </summary>
 /// <remarks>
 /// &lt;br/&gt;**Required scope**: Workspace.Read.All or
 /// Workspace.ReadWrite.All&lt;br/&gt;To set the permissions scope, see
 /// [Register an
 /// app](https://docs.microsoft.com/power-bi/developer/register-app).
 /// </remarks>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='groupId'>
 /// The workspace id
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <GroupUsers> GetGroupUsersAsync(this IGroupsOperations operations, System.Guid groupId, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.GetGroupUsersWithHttpMessagesAsync(groupId, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
 /// <summary>
 /// Creates new group.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.Azure.Management.ApiManagement.IGroupsOperations.
 /// </param>
 /// <param name='resourceGroupName'>
 /// Required. The name of the resource group.
 /// </param>
 /// <param name='serviceName'>
 /// Required. The name of the Api Management service.
 /// </param>
 /// <param name='gid'>
 /// Required. Identifier of the group.
 /// </param>
 /// <param name='parameters'>
 /// Required. Create parameters.
 /// </param>
 /// <returns>
 /// A standard service response including an HTTP status code and
 /// request ID.
 /// </returns>
 public static AzureOperationResponse Create(this IGroupsOperations operations, string resourceGroupName, string serviceName, string gid, GroupCreateParameters parameters)
 {
     return(Task.Factory.StartNew((object s) =>
     {
         return ((IGroupsOperations)s).CreateAsync(resourceGroupName, serviceName, gid, parameters);
     }
                                  , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
 /// <summary>
 /// List next groups page.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.Azure.Management.ApiManagement.IGroupsOperations.
 /// </param>
 /// <param name='nextLink'>
 /// Required. NextLink from the previous successful call to List
 /// operation.
 /// </param>
 /// <returns>
 /// List Groups operation response details.
 /// </returns>
 public static GroupListResponse ListNext(this IGroupsOperations operations, string nextLink)
 {
     return(Task.Factory.StartNew((object s) =>
     {
         return ((IGroupsOperations)s).ListNextAsync(nextLink);
     }
                                  , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
 /// <summary>
 /// List all groups.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.Azure.Management.ApiManagement.IGroupsOperations.
 /// </param>
 /// <param name='resourceGroupName'>
 /// Required. The name of the resource group.
 /// </param>
 /// <param name='serviceName'>
 /// Required. The name of the Api Management service.
 /// </param>
 /// <param name='query'>
 /// Optional.
 /// </param>
 /// <returns>
 /// List Groups operation response details.
 /// </returns>
 public static GroupListResponse List(this IGroupsOperations operations, string resourceGroupName, string serviceName, QueryParameters query)
 {
     return(Task.Factory.StartNew((object s) =>
     {
         return ((IGroupsOperations)s).ListAsync(resourceGroupName, serviceName, query);
     }
                                  , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
예제 #18
0
 public PowerBIClientWrapper(string workspaceName, string clientId, IImportsOperations importClient, IReportsOperations reportsClient, IGroupsOperations groupsClient)
 {
     this.ClientId      = clientId;
     this.importClient  = importClient;
     this.reportsClient = reportsClient;
     this.groupsClient  = groupsClient;
     GetWorkspaces(workspaceName);
 }
예제 #19
0
        private void InitializeClients()
        {
            AuthenticationResult result = DoInteractiveSignIn();

            client = new PowerBIClient(new Uri(PowerBIWrapperConstants.PowerBiApiUri), new TokenCredentials(result.AccessToken));

            importClient  = new ImportsOperations(client);
            reportsClient = new ReportsOperations(client);
            groupsClient  = new GroupsOperations(client);
        }
 /// <summary>
 /// Initializes a new instance of the ApiManagementClient class.
 /// </summary>
 /// <param name='httpClient'>
 /// The Http client
 /// </param>
 public ApiManagementClient(HttpClient httpClient)
     : base(httpClient)
 {
     this._apiOperationPolicy = new ApiOperationPolicyOperations(this);
     this._apiOperations      = new ApiOperationsOperations(this);
     this._apiPolicy          = new ApiPolicyOperations(this);
     this._apiProducts        = new ApiProductsOperations(this);
     this._apis = new ApisOperations(this);
     this._authorizationServers = new AuthorizationServersOperations(this);
     this._backends             = new BackendOperations(this);
     this._certificates         = new CertificatesOperations(this);
     this._groups                       = new GroupsOperations(this);
     this._groupUsers                   = new GroupUsersOperations(this);
     this._identityProvider             = new IdentityProviderOperations(this);
     this._loggers                      = new LoggerOperations(this);
     this._openIdConnectProviders       = new OpenIdConnectProvidersOperations(this);
     this._policySnippents              = new PolicySnippetsOperations(this);
     this._productApis                  = new ProductApisOperations(this);
     this._productGroups                = new ProductGroupsOperations(this);
     this._productPolicy                = new ProductPolicyOperations(this);
     this._products                     = new ProductsOperations(this);
     this._productSubscriptions         = new ProductSubscriptionsOperations(this);
     this._property                     = new PropertiesOperations(this);
     this._regions                      = new RegionsOperations(this);
     this._reports                      = new ReportsOperations(this);
     this._resourceProvider             = new ResourceProviderOperations(this);
     this._subscriptions                = new SubscriptionsOperations(this);
     this._tenantAccessGit              = new TenantAccessGitOperations(this);
     this._tenantAccess                 = new TenantAccessInformationOperations(this);
     this._tenantConfiguration          = new TenantConfigurationOperations(this);
     this._tenantConfigurationSyncState = new TenantConfigurationSyncStateOperation(this);
     this._tenantPolicy                 = new TenantPolicyOperations(this);
     this._userApplications             = new UserApplicationsOperations(this);
     this._userGroups                   = new UserGroupsOperations(this);
     this._userIdentities               = new UserIdentitiesOperations(this);
     this._users             = new UsersOperations(this);
     this._userSubscriptions = new UserSubscriptionsOperations(this);
     this._apiVersion        = "2016-10-10";
     this._longRunningOperationInitialTimeout = -1;
     this._longRunningOperationRetryTimeout   = -1;
     this.HttpClient.Timeout = TimeSpan.FromSeconds(300);
 }
 /// <summary>
 /// Creates new workspace.
 /// </summary>
 /// <remarks>
 /// &lt;br/&gt;**Required scope**: Workspace.ReadWrite.All&lt;br/&gt;To set the
 /// permissions scope, see [Register an
 /// app](https://docs.microsoft.com/power-bi/developer/register-app).
 /// </remarks>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='requestParameters'>
 /// Create group request parameters
 /// </param>
 /// <param name='workspaceV2'>
 /// Preview feature: Create a workspace V2. The only supported value is true.
 /// </param>
 public static Group CreateGroup(this IGroupsOperations operations, GroupCreationRequest requestParameters, bool?workspaceV2 = default(bool?))
 {
     return(operations.CreateGroupAsync(requestParameters, workspaceV2).GetAwaiter().GetResult());
 }
 /// <summary>
 /// Restores a deleted workspace.
 /// </summary>
 /// <remarks>
 /// **Note**: This API is currently limited to restoring workspaces in the new
 /// workspace experience. The user must have administrator rights (such as
 /// Office 365 Global Administrator or Power BI Service Administrator) to call
 /// this API. &lt;br/&gt;This API allows 200 requests per hour at maximum.
 /// &lt;br/&gt;This API allows 200 requests per hour at maximum.
 /// &lt;br/&gt;&lt;br/&gt;**Required scope**: Tenant.ReadWrite.All&lt;br/&gt;To
 /// set the permissions scope, see [Register an
 /// app](https://docs.microsoft.com/power-bi/developer/register-app).
 /// </remarks>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='groupId'>
 /// The workspace id
 /// </param>
 /// <param name='groupRestoreRequest'>
 /// Details of the group restore request
 /// </param>
 public static void RestoreDeletedGroupAsAdmin(this IGroupsOperations operations, System.Guid groupId, GroupRestoreRequest groupRestoreRequest)
 {
     operations.RestoreDeletedGroupAsAdminAsync(groupId, groupRestoreRequest).GetAwaiter().GetResult();
 }
 /// <summary>
 /// Restores a deleted workspace.
 /// </summary>
 /// <remarks>
 /// **Note**: This API is currently limited to restoring workspaces in the new
 /// workspace experience. The user must have administrator rights (such as
 /// Office 365 Global Administrator or Power BI Service Administrator) to call
 /// this API. &lt;br/&gt;This API allows 200 requests per hour at maximum.
 /// &lt;br/&gt;This API allows 200 requests per hour at maximum.
 /// &lt;br/&gt;&lt;br/&gt;**Required scope**: Tenant.ReadWrite.All&lt;br/&gt;To
 /// set the permissions scope, see [Register an
 /// app](https://docs.microsoft.com/power-bi/developer/register-app).
 /// </remarks>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='groupId'>
 /// The workspace id
 /// </param>
 /// <param name='groupRestoreRequest'>
 /// Details of the group restore request
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task RestoreDeletedGroupAsAdminAsync(this IGroupsOperations operations, System.Guid groupId, GroupRestoreRequest groupRestoreRequest, CancellationToken cancellationToken = default(CancellationToken))
 {
     (await operations.RestoreDeletedGroupAsAdminWithHttpMessagesAsync(groupId, groupRestoreRequest, null, cancellationToken).ConfigureAwait(false)).Dispose();
 }
 /// <summary>
 /// Removes user permissions to the specified workspace.
 /// </summary>
 /// <remarks>
 /// **Note:** This API is currently limited to updating workspaces in the new
 /// workspace experience and adding user principle only. The user must have
 /// administrator rights (such as Office 365 Global Administrator or Power BI
 /// Service Administrator) to call this API. &lt;br/&gt;This API allows 200
 /// requests per hour at maximum. &lt;br/&gt;&lt;br/&gt;**Required scope**:
 /// Tenant.ReadWrite.All&lt;br/&gt;To set the permissions scope, see [Register
 /// an app](https://docs.microsoft.com/power-bi/developer/register-app).
 /// </remarks>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='groupId'>
 /// The workspace id
 /// </param>
 /// <param name='user'>
 /// The user principal name (UPN) of the user to remove (usually the user's
 /// email).
 /// </param>
 public static void DeleteUserAsAdmin(this IGroupsOperations operations, System.Guid groupId, string user)
 {
     operations.DeleteUserAsAdminAsync(groupId, user).GetAwaiter().GetResult();
 }
 /// <summary>
 /// Removes user permissions to the specified workspace.
 /// </summary>
 /// <remarks>
 /// **Note:** This API is currently limited to updating workspaces in the new
 /// workspace experience and adding user principle only. The user must have
 /// administrator rights (such as Office 365 Global Administrator or Power BI
 /// Service Administrator) to call this API. &lt;br/&gt;This API allows 200
 /// requests per hour at maximum. &lt;br/&gt;&lt;br/&gt;**Required scope**:
 /// Tenant.ReadWrite.All&lt;br/&gt;To set the permissions scope, see [Register
 /// an app](https://docs.microsoft.com/power-bi/developer/register-app).
 /// </remarks>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='groupId'>
 /// The workspace id
 /// </param>
 /// <param name='user'>
 /// The user principal name (UPN) of the user to remove (usually the user's
 /// email).
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task DeleteUserAsAdminAsync(this IGroupsOperations operations, System.Guid groupId, string user, CancellationToken cancellationToken = default(CancellationToken))
 {
     (await operations.DeleteUserAsAdminWithHttpMessagesAsync(groupId, user, null, cancellationToken).ConfigureAwait(false)).Dispose();
 }
 /// <summary>
 /// Grants user permissions to the specified workspace.
 /// </summary>
 /// <remarks>
 /// **Note:** This API is currently limited to updating workspaces in the new
 /// workspace experience and adding user principle only. The user must have
 /// administrator rights (such as Office 365 Global Administrator or Power BI
 /// Service Administrator) to call this API. &lt;br/&gt;This API allows 200
 /// requests per hour at maximum. &lt;br/&gt;&lt;br/&gt;**Required scope**:
 /// Tenant.ReadWrite.All&lt;br/&gt;To set the permissions scope, see [Register
 /// an app](https://docs.microsoft.com/power-bi/developer/register-app).
 /// </remarks>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='groupId'>
 /// The workspace id
 /// </param>
 /// <param name='userDetails'>
 /// Details of user access right
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task AddUserAsAdminAsync(this IGroupsOperations operations, System.Guid groupId, GroupUser userDetails, CancellationToken cancellationToken = default(CancellationToken))
 {
     (await operations.AddUserAsAdminWithHttpMessagesAsync(groupId, userDetails, null, cancellationToken).ConfigureAwait(false)).Dispose();
 }
 /// <summary>
 /// Grants user permissions to the specified workspace.
 /// </summary>
 /// <remarks>
 /// **Note:** This API is currently limited to updating workspaces in the new
 /// workspace experience and adding user principle only. The user must have
 /// administrator rights (such as Office 365 Global Administrator or Power BI
 /// Service Administrator) to call this API. &lt;br/&gt;This API allows 200
 /// requests per hour at maximum. &lt;br/&gt;&lt;br/&gt;**Required scope**:
 /// Tenant.ReadWrite.All&lt;br/&gt;To set the permissions scope, see [Register
 /// an app](https://docs.microsoft.com/power-bi/developer/register-app).
 /// </remarks>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='groupId'>
 /// The workspace id
 /// </param>
 /// <param name='userDetails'>
 /// Details of user access right
 /// </param>
 public static void AddUserAsAdmin(this IGroupsOperations operations, System.Guid groupId, GroupUser userDetails)
 {
     operations.AddUserAsAdminAsync(groupId, userDetails).GetAwaiter().GetResult();
 }
 /// <summary>
 /// Updates the specified workspace properties.
 /// </summary>
 /// <remarks>
 /// **Note**: This API is currently limited to updating workspaces in the new
 /// workspace experience. Only name and description can be updated, and name
 /// must be unique inside an organization. The user must have administrator
 /// rights (such as Office 365 Global Administrator or Power BI Service
 /// Administrator) to call this API. &lt;br/&gt;This API allows 200 requests
 /// per hour at maximum. &lt;br/&gt;&lt;br/&gt;**Required scope**:
 /// Tenant.ReadWrite.All&lt;br/&gt;To set the permissions scope, see [Register
 /// an app](https://docs.microsoft.com/power-bi/developer/register-app).
 /// </remarks>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='groupId'>
 /// The workspace id
 /// </param>
 /// <param name='groupProperties'>
 /// The properties to update
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task UpdateGroupAsAdminAsync(this IGroupsOperations operations, System.Guid groupId, Group groupProperties, CancellationToken cancellationToken = default(CancellationToken))
 {
     (await operations.UpdateGroupAsAdminWithHttpMessagesAsync(groupId, groupProperties, null, cancellationToken).ConfigureAwait(false)).Dispose();
 }
 /// <summary>
 /// Updates the specified workspace properties.
 /// </summary>
 /// <remarks>
 /// **Note**: This API is currently limited to updating workspaces in the new
 /// workspace experience. Only name and description can be updated, and name
 /// must be unique inside an organization. The user must have administrator
 /// rights (such as Office 365 Global Administrator or Power BI Service
 /// Administrator) to call this API. &lt;br/&gt;This API allows 200 requests
 /// per hour at maximum. &lt;br/&gt;&lt;br/&gt;**Required scope**:
 /// Tenant.ReadWrite.All&lt;br/&gt;To set the permissions scope, see [Register
 /// an app](https://docs.microsoft.com/power-bi/developer/register-app).
 /// </remarks>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='groupId'>
 /// The workspace id
 /// </param>
 /// <param name='groupProperties'>
 /// The properties to update
 /// </param>
 public static void UpdateGroupAsAdmin(this IGroupsOperations operations, System.Guid groupId, Group groupProperties)
 {
     operations.UpdateGroupAsAdminAsync(groupId, groupProperties).GetAwaiter().GetResult();
 }
 /// <summary>
 /// Returns a list of workspaces for the organization.
 /// </summary>
 /// <remarks>
 /// **Note:** The user must have administrator rights (such as Office 365
 /// Global Administrator or Power BI Service Administrator) to call this API.
 /// &lt;br/&gt;This API allows 200 requests per hour at maximum.
 /// &lt;br/&gt;&lt;br/&gt;**Required scope**: Tenant.Read.All or
 /// Tenant.ReadWrite.All&lt;br/&gt;To set the permissions scope, see [Register
 /// an app](https://docs.microsoft.com/power-bi/developer/register-app).
 /// </remarks>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='top'>
 /// Returns only the first n results. This parameter is mandatory and must be
 /// in the range of 1-5000.
 /// </param>
 /// <param name='expand'>
 /// Expands related entities inline, receives a comma-separated list of data
 /// types. Supported: users, reports, dashboards, datasets, dataflows,
 /// workbooks
 /// </param>
 /// <param name='filter'>
 /// Filters the results based on a boolean condition
 /// </param>
 /// <param name='skip'>
 /// Skips the first n results. Use with top to fetch results beyond the first
 /// 5000.
 /// </param>
 public static Groups GetGroupsAsAdmin(this IGroupsOperations operations, int top, string expand = default(string), string filter = default(string), int?skip = default(int?))
 {
     return(operations.GetGroupsAsAdminAsync(top, expand, filter, skip).GetAwaiter().GetResult());
 }