protected EncryptionKey GetEncryptionKey(IPowerBIApiClient client, string keyName)
        {
            var tenantKeys = this.GetEncryptionKeys(client);

            if (tenantKeys == null)
            {
                return(null);
            }

            return(GetMatchingEncryptionKey(tenantKeys, keyName));
        }
        private IEnumerable <EncryptionKey> GetEncryptionKeys(IPowerBIApiClient client)
        {
            var tenantKeys = client.Admin.GetPowerBIEncryptionKeys();

            if (tenantKeys == null || !tenantKeys.Any())
            {
                this.Logger.ThrowTerminatingError("No encryption keys are set");
                return(null);
            }

            return(tenantKeys);
        }
 public TestPowerBICmdletInitFactory(IPowerBIApiClient client) :
     base(new TestLoggerFactory(), new ModuleDataStorage(), new TestAuthenticator(), new PowerBISettings(), new TestClient(client)) => this.SetProfile();
Exemple #4
0
 private Workspace GetWorkspace(IPowerBIApiClient client, string workspaceName)
 {
     string nameFilter = $"name eq '{workspaceName}'";
     var    workspaces = client.Workspaces.GetWorkspacesAsAdmin(default, nameFilter, 1, default);
Exemple #5
0
 public TestClient(IPowerBIApiClient client) => this.Client = client;