diff --git a/Graph.Community.lutconfig b/Graph.Community.lutconfig
deleted file mode 100644
index 596a860..0000000
--- a/Graph.Community.lutconfig
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
- true
- true
- 180000
-
\ No newline at end of file
diff --git a/samples/ApplicationPermissions.cs b/samples/ApplicationPermissions.cs
deleted file mode 100644
index 95923ac..0000000
--- a/samples/ApplicationPermissions.cs
+++ /dev/null
@@ -1,82 +0,0 @@
-using Azure.Identity;
-using Microsoft.Extensions.Options;
-using Microsoft.Graph;
-using System;
-using System.Linq;
-using System.Threading.Tasks;
-
-namespace Graph.Community.Samples
-{
- public class ApplicationPermissions
- {
- private readonly AzureAdSettings azureAdSettings;
-
- public ApplicationPermissions(
- IOptions azureAdOptions)
- {
- this.azureAdSettings = azureAdOptions.Value;
- }
-
-
- public async Task Run()
- {
- //////////////////////
- //
- // TokenCredential
- //
- //////////////////////
-
- var credential = new ChainedTokenCredential(
- new SharedTokenCacheCredential(new SharedTokenCacheCredentialOptions() { TenantId = azureAdSettings.TenantId, ClientId = azureAdSettings.ClientId }),
- new VisualStudioCredential(new VisualStudioCredentialOptions { TenantId = azureAdSettings.TenantId }),
- new InteractiveBrowserCredential(new InteractiveBrowserCredentialOptions { TenantId = azureAdSettings.TenantId, ClientId = azureAdSettings.ClientId })
- );
-
- ////////////////////////////////////////////////////////////////
- //
- // Create a GraphClient
- //
- ////////////////////////////////////////////////////////////////
-
- // Configure our client
- CommunityGraphClientOptions clientOptions = new CommunityGraphClientOptions()
- {
- UserAgent = "ApplicationPermissionsSample"
- };
-
- var graphServiceClient = CommunityGraphClientFactory.Create(clientOptions, credential);
-
- ///////////////////////////////////////
- //
- // Setup is complete, run the sample
- //
- ///////////////////////////////////////
-
-
- Console.WriteLine("Enter application id:");
- var appId = Console.ReadLine().Trim();
-
- var scopes = new string[] { "Application.Read.All" };
-
- var results = await graphServiceClient
- .Applications
- .Request()
- .Filter($"appId eq '{appId}'")
- .WithScopes(scopes)
- .GetAsync();
-
- var app = results.CurrentPage.FirstOrDefault();
- if (app == null)
- {
- Console.WriteLine("App not found");
- return;
- }
-
- foreach (var requiredResourceAccess in app.RequiredResourceAccess)
- {
- Console.WriteLine(requiredResourceAccess.ResourceAppId);
- }
-
- }
- }
-}
diff --git a/samples/ChangeLog.cs b/samples/ChangeLog.cs
index c1e02ee..bf315dd 100644
--- a/samples/ChangeLog.cs
+++ b/samples/ChangeLog.cs
@@ -59,47 +59,38 @@ public async Task Run()
// Setup is complete, run the sample
//
///////////////////////////////////////
- try
- {
-
-
- var scopes = new string[] { $"https://{sharePointSettings.Hostname}/AllSites.FullControl" };
- var WebUrl = $"https://{sharePointSettings.Hostname}{sharePointSettings.SiteCollectionUrl}";
- var web = await graphServiceClient
- .SharePointAPI(WebUrl)
- .Web
- .Request()
- .WithScopes(scopes)
- .GetAsync();
+ var scopes = new string[] { $"https://{sharePointSettings.Hostname}/AllSites.FullControl" };
+ var WebUrl = $"https://{sharePointSettings.Hostname}{sharePointSettings.SiteCollectionUrl}";
- var changeToken = web.CurrentChangeToken;
- Console.WriteLine($"current change token: {changeToken.StringValue}");
+ var web = await graphServiceClient
+ .SharePointAPI(WebUrl)
+ .Web
+ .Request()
+ .WithScopes(scopes)
+ .GetAsync();
- Console.WriteLine($"Make an update to the site {WebUrl}");
- Console.WriteLine("Press enter to continue");
- Console.ReadLine();
+ var changeToken = web.CurrentChangeToken;
+ Console.WriteLine($"current change token: {changeToken.StringValue}");
- var qry = new ChangeQuery(true, true);
- qry.ChangeTokenStart = changeToken;
+ Console.WriteLine($"Make an update to the site {WebUrl}");
+ Console.WriteLine("Press enter to continue");
+ Console.ReadLine();
- var changes = await graphServiceClient
- .SharePointAPI(WebUrl)
- .Web
- .Request()
- .GetChangesAsync(qry);
+ var qry = new ChangeQuery(true, true);
+ qry.ChangeTokenStart = changeToken;
- Console.WriteLine(changes.Count);
+ var changes = await graphServiceClient
+ .SharePointAPI(WebUrl)
+ .Web
+ .Request()
+ .GetChangesAsync(qry);
- foreach (var item in changes)
- {
- Console.WriteLine($"{item.ChangeType}");
- }
+ Console.WriteLine(changes.Count);
- }
- catch (Exception ex)
+ foreach (var item in changes)
{
- Console.WriteLine(ex.Message);
+ Console.WriteLine($"{item.ChangeType}");
}
Console.WriteLine("Press enter to show log");
diff --git a/samples/Graph.Community.Samples.lutconfig b/samples/Graph.Community.Samples.lutconfig
deleted file mode 100644
index ff7fdf3..0000000
--- a/samples/Graph.Community.Samples.lutconfig
+++ /dev/null
@@ -1,6 +0,0 @@
-
- ..\
- true
- true
- 180000
-
\ No newline at end of file
diff --git a/samples/ListFields.cs b/samples/ListFields.cs
deleted file mode 100644
index a6504a1..0000000
--- a/samples/ListFields.cs
+++ /dev/null
@@ -1,105 +0,0 @@
-using Azure.Identity;
-using Microsoft.Extensions.Options;
-using Microsoft.Graph;
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Threading.Tasks;
-
-namespace Graph.Community.Samples
-{
- public class ListFields
- {
- private readonly AzureAdSettings azureAdSettings;
- private readonly SharePointSettings sharePointSettings;
-
- public ListFields(
- IOptions azureAdOptions,
- IOptions sharePointOptions)
- {
- this.azureAdSettings = azureAdOptions.Value;
- this.sharePointSettings = sharePointOptions.Value;
- }
-
- public async Task Run()
- {
- //////////////////////
- //
- // TokenCredential
- //
- //////////////////////
-
- var credential = new ChainedTokenCredential(
- //new SharedTokenCacheCredential(new SharedTokenCacheCredentialOptions() { TenantId = azureAdSettings.TenantId, ClientId = azureAdSettings.ClientId }),
- //new VisualStudioCredential(new VisualStudioCredentialOptions { TenantId = azureAdSettings.TenantId }),
- new InteractiveBrowserCredential(new InteractiveBrowserCredentialOptions { TenantId = azureAdSettings.TenantId, ClientId = azureAdSettings.ClientId })
- );
-
-
- ////////////////////////////////////////////////////////////
- //
- // Graph Client with Logger and SharePoint service handler
- //
- ////////////////////////////////////////////////////////////
-
- var logger = new StringBuilderHttpMessageLogger();
- /*
- * Could also use the Console if preferred...
- *
- * var logger = new ConsoleHttpMessageLogger();
- */
-
- // Configure our client
- CommunityGraphClientOptions clientOptions = new CommunityGraphClientOptions()
- {
- UserAgent = "SiteGroupsSample"
- };
- var graphServiceClient = CommunityGraphClientFactory.Create(clientOptions, logger, credential);
-
- ///////////////////////////////////////
- //
- // Setup is complete, run the sample
- //
- ///////////////////////////////////////
-
- var scopes = new string[] { $"https://{sharePointSettings.Hostname}/AllSites.FullControl" };
- var WebUrl = $"https://{sharePointSettings.Hostname}{sharePointSettings.SiteCollectionUrl}";
-
- try
- {
- var fieldsResult = await graphServiceClient
- .SharePointAPI(WebUrl)
- .Web
- .Lists[new Guid("5387d82e-062e-4267-a60e-840f89f947d8")]
- .Fields
- .Request()
- .WithScopes(scopes)
- .GetAsync();
-
- // SharePoint doesn't return nextPage link, so can't use iterator
- //var pageIterator = PageIterator.CreatePageIterator(graphServiceClient, fieldsResult, iteratorItemCallback, iteratorRequestConfigurator);
- //await pageIterator.IterateAsync();
-
- Console.WriteLine();
- Console.WriteLine();
-
- foreach (var field in fieldsResult.CurrentPage)
- {
- Console.WriteLine($"{field.Title,-50} {field.InternalName, -35} {field.TypeDisplayName}");
- }
- }
- catch (Exception ex)
- {
- Console.WriteLine(ex.Message);
- }
-
-
- Console.WriteLine("Press enter to show log");
- Console.ReadLine();
- Console.WriteLine();
- var log = logger.GetLog();
- Console.WriteLine(log);
- }
-
- }
-}
diff --git a/samples/MenuService.cs b/samples/MenuService.cs
index 77d069d..c4a54bd 100644
--- a/samples/MenuService.cs
+++ b/samples/MenuService.cs
@@ -45,8 +45,8 @@ private async ValueTask MenuAsync()
Console.WriteLine("5. Site Pages");
Console.WriteLine("6. SharePoint Search");
Console.WriteLine("7. Site Design");
- Console.WriteLine("8. Site");
- Console.WriteLine("9. Application Permissions");
+ Console.WriteLine("8. Group extensions (Graph)");
+ //Console.WriteLine("9. ");
Console.WriteLine("");
Console.WriteLine("");
Console.WriteLine("Ctrl+C to Exit");
@@ -104,14 +104,12 @@ private async ValueTask MenuAsync()
case ConsoleKey.D8:
case ConsoleKey.NumPad8:
- var siteSample = serviceProvider.GetRequiredService();
- await siteSample.Run();
+ var graphGroupSample = serviceProvider.GetRequiredService();
+ await graphGroupSample.Run();
break;
case ConsoleKey.D9:
case ConsoleKey.NumPad9:
- var applicationPermissionsSample = serviceProvider.GetRequiredService();
- await applicationPermissionsSample.Run();
break;
default:
break;
diff --git a/samples/Program.cs b/samples/Program.cs
index a8c5592..e3b97b5 100644
--- a/samples/Program.cs
+++ b/samples/Program.cs
@@ -59,9 +59,6 @@ static async Task Main(string[] args)
services.AddTransient();
services.AddTransient();
services.AddTransient();
- services.AddTransient();
- services.AddTransient();
- services.AddTransient();
})
.Build();
diff --git a/samples/Site.cs b/samples/Site.cs
deleted file mode 100644
index aeece86..0000000
--- a/samples/Site.cs
+++ /dev/null
@@ -1,101 +0,0 @@
-using Azure.Identity;
-using Microsoft.Extensions.Options;
-using Microsoft.Graph;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
-namespace Graph.Community.Samples
-{
- public class Site
- {
- private readonly AzureAdSettings azureAdSettings;
- private readonly SharePointSettings sharePointSettings;
-
- public Site(
- IOptions azureAdOptions,
- IOptions sharePointOptions)
- {
- this.azureAdSettings = azureAdOptions.Value;
- this.sharePointSettings = sharePointOptions.Value;
- }
-
- public async Task Run()
- {
- //////////////////////
- //
- // TokenCredential
- //
- //////////////////////
-
- var credential = new ChainedTokenCredential(
- new SharedTokenCacheCredential(new SharedTokenCacheCredentialOptions() { TenantId = azureAdSettings.TenantId, ClientId = azureAdSettings.ClientId }),
- new VisualStudioCredential(new VisualStudioCredentialOptions { TenantId = azureAdSettings.TenantId }),
- new InteractiveBrowserCredential(new InteractiveBrowserCredentialOptions { TenantId = azureAdSettings.TenantId, ClientId = azureAdSettings.ClientId })
- );
-
-
- ////////////////////////////////////////////////////////////
- //
- // Graph Client with Logger and SharePoint service handler
- //
- ////////////////////////////////////////////////////////////
-
- var logger = new StringBuilderHttpMessageLogger();
- /*
- * Could also use the Console if preferred...
- *
- * var logger = new ConsoleHttpMessageLogger();
- */
-
- // Configure our client
- CommunityGraphClientOptions clientOptions = new CommunityGraphClientOptions()
- {
- UserAgent = "SiteGroupsSample"
- };
- var graphServiceClient = CommunityGraphClientFactory.Create(clientOptions, logger, credential);
-
- ///////////////////////////////////////
- //
- // Setup is complete, run the sample
- //
- ///////////////////////////////////////
-
- var scopes = new string[] { $"https://{sharePointSettings.Hostname}/AllSites.FullControl" };
- var WebUrl = $"https://{sharePointSettings.Hostname}{sharePointSettings.SiteCollectionUrl}";
-
- try
- {
- var site = await graphServiceClient
- .SharePointAPI(WebUrl)
- .Site
- .Request()
- .WithScopes(scopes)
- .GetAsync();
-
-
- Console.WriteLine($"{site.ServerRelativeUrl} - {site.Id} - {site.Name}");
-
- var siteAssets = await graphServiceClient
- .SharePointAPI(WebUrl)
- .Web
- .Request()
- .WithScopes(scopes)
- .EnsureSiteAssetsAsync();
- }
- catch (Exception ex)
- {
- Console.WriteLine(ex.Message);
- }
-
-
- Console.WriteLine("Press enter to show log");
- Console.ReadLine();
- Console.WriteLine();
- var log = logger.GetLog();
- Console.WriteLine(log);
- }
- }
-}
diff --git a/samples/SiteDesign.cs b/samples/SiteDesign.cs
index 6388fce..d2a1376 100644
--- a/samples/SiteDesign.cs
+++ b/samples/SiteDesign.cs
@@ -65,19 +65,17 @@ public async Task Run()
var siteScript = new SiteScriptMetadata()
{
- Title = "Green's Theme",
- Description = "Apply the Green's Theme",
- Content = "{\"$schema\": \"schema.json\",\"actions\": [{\"verb\": \"applyTheme\",\"themeName\": \"Green's theme\"}],\"bindata\": { },\"version\": 1}",
+ Title = "Green Theme",
+ Description = "Apply the Green Theme",
+ Content = "{\"$schema\": \"schema.json\",\"actions\": [{\"verb\": \"applyTheme\",\"themeName\": \"Green\"}],\"bindata\": { },\"version\": 1}",
};
- try
- {
- var createdScript = await graphServiceClient
- .SharePointAPI(WebUrl)
- .SiteScripts
- .Request()
- .WithScopes(scopes)
- .CreateAsync(siteScript);
+ var createdScript = await graphServiceClient
+ .SharePointAPI(WebUrl)
+ .SiteScripts
+ .Request()
+ .WithScopes(scopes)
+ .CreateAsync(siteScript);
var siteDesign = new SiteDesignMetadata()
{
@@ -94,23 +92,23 @@ public async Task Run()
.WithScopes(scopes)
.CreateAsync(siteDesign);
- //var applySiteDesignRequest = new ApplySiteDesignRequest
- //{
- // SiteDesignId = createdDesign.Id,
- // WebUrl = WebUrl
- //};
+ var applySiteDesignRequest = new ApplySiteDesignRequest
+ {
+ SiteDesignId = createdDesign.Id,
+ WebUrl = WebUrl
+ };
- //var applySiteDesignResponse = await graphServiceClient
- // .SharePointAPI(WebUrl)
- // .SiteDesigns
- // .Request()
- // .WithScopes(scopes)
- // .ApplyAsync(applySiteDesignRequest);
+ var applySiteDesignResponse = await graphServiceClient
+ .SharePointAPI(WebUrl)
+ .SiteDesigns
+ .Request()
+ .WithScopes(scopes)
+ .ApplyAsync(applySiteDesignRequest);
- //foreach (var outcome in applySiteDesignResponse.CurrentPage)
- //{
- // Console.WriteLine(outcome.OutcomeText);
- //}
+ foreach (var outcome in applySiteDesignResponse.CurrentPage)
+ {
+ Console.WriteLine(outcome.OutcomeText);
+ }
Console.WriteLine("Press enter to show log");
@@ -118,13 +116,6 @@ public async Task Run()
Console.WriteLine();
var log = logger.GetLog();
Console.WriteLine(log);
-
- }
- catch (Exception ex)
- {
- var errlog = logger.GetLog();
- Console.Write(errlog);
- }
- }
- }
+ }
+ }
}
diff --git a/samples/TeamsTab.cs b/samples/TeamsTab.cs
deleted file mode 100644
index 276df70..0000000
--- a/samples/TeamsTab.cs
+++ /dev/null
@@ -1,153 +0,0 @@
-using Azure.Identity;
-using Microsoft.Extensions.Options;
-using Microsoft.Graph;
-using System;
-using System.Linq;
-using System.Threading.Tasks;
-
-namespace Graph.Community.Samples
-{
- public class TeamsTab
- {
- private readonly AzureAdSettings azureAdSettings;
-
- public TeamsTab(
- IOptions azureAdOptions)
- {
- this.azureAdSettings = azureAdOptions.Value;
- }
-
- public async Task Run()
- {
- //////////////////////
- //
- // TokenCredential
- //
- //////////////////////
-
- var credential = new ChainedTokenCredential(
- new SharedTokenCacheCredential(new SharedTokenCacheCredentialOptions() { TenantId = azureAdSettings.TenantId, ClientId = azureAdSettings.ClientId }),
- new VisualStudioCredential(new VisualStudioCredentialOptions { TenantId = azureAdSettings.TenantId }),
- new InteractiveBrowserCredential(new InteractiveBrowserCredentialOptions { TenantId = azureAdSettings.TenantId, ClientId = azureAdSettings.ClientId })
- );
-
- ////////////////////////////////////////////////////////////
- //
- // Graph Client with Logger and SharePoint service handler
- //
- ////////////////////////////////////////////////////////////
-
- var logger = new StringBuilderHttpMessageLogger();
-
- // Configure our client
- CommunityGraphClientOptions clientOptions = new CommunityGraphClientOptions()
- {
- UserAgent = "TeamsTab"
- };
-
- var graphServiceClient = CommunityGraphClientFactory.Create(clientOptions, logger, credential);
-
- ///////////////////////////////////////
- //
- // Setup is complete, run the sample
- //
- ///////////////////////////////////////
-
- var teamId = "4fe37106-1d3a-465b-b178-9c39d6aeb343";
- var channelId = "19:t-MikaBv26FK2VZnqLTQmAtFvoZ4_fCKOKX7S2dXT_k1@thread.tacv2";
-
- var scopes = new string[] { "TeamsTab.Create" };
-
- var newChannelTabRequest = new CreateChannelTabRequest()
- {
- DisplayName = $"GCTest:{DateTime.Now.ToShortTimeString()}",
- TeamsAppId = "2a527703-1f6f-4559-a332-d8a7d288cd88",
- Configuration = new Microsoft.Graph.TeamsTabConfiguration
- {
- ContentUrl = "https://devaddin365.sharepoint.com/sites/tabstest/_layouts/15/teamslogon.aspx?spfx=true&dest=https%3A%2F%2Fdevaddin365.sharepoint.com%2Fsites%2FTabstest%2FSitePages%2FHome.aspx",
- RemoveUrl = null,
- WebsiteUrl = "https://devaddin365.sharepoint.com/sites/Tabstest/SitePages/Home.aspx"
- }
- };
-
-
- var newTabRequest = newChannelTabRequest.ToTeamsTab();
-
-
- var newTab = await graphServiceClient.Teams[teamId]
- .Channels[channelId]
- .Tabs
- .Request()
- .WithScopes(scopes)
- .AddAsync(newTabRequest);
-
- Console.WriteLine();
- Console.WriteLine();
- Console.WriteLine(newTab.Id);
-
- Console.WriteLine();
- Console.WriteLine("Press enter to show log");
- Console.ReadLine();
- Console.WriteLine();
- var log = logger.GetLog();
- Console.WriteLine(log);
-
- }
- }
-
-
- public class CreateChannelTabRequest
- {
- public string DisplayName { get; set; }
-
- private string teamsAppId;
- public string TeamsAppId
- {
- get
- {
- return $"https://graph.microsoft.com/v1.0/appCatalogs/teamsApps/{teamsAppId}";
- }
- set
- {
- teamsAppId = value;
- }
- }
-
- public Microsoft.Graph.TeamsTabConfiguration Configuration { get; set; }
-
- public Microsoft.Graph.TeamsTab ToTeamsTab()
- {
- if (this.TeamsAppId == "com.microsoft.teamspace.tab.web")
- {
- this.Configuration.EntityId = null;
- this.Configuration.RemoveUrl = null;
- }
- else if (this.TeamsAppId == "com.microsoftstream.embed.skypeteamstab")
- {
- this.Configuration.EntityId = null;
- this.Configuration.RemoveUrl = null;
- }
- else if (this.TeamsAppId == "81fef3a6-72aa-4648-a763-de824aeafb7d")
- {
- this.Configuration.RemoveUrl = null;
- this.Configuration.WebsiteUrl = "https://forms.office.com";
- }
- else if (this.TeamsAppId == "com.microsoft.teamspace.tab.files.sharepoint")
- {
- this.Configuration.EntityId = "";
- this.Configuration.RemoveUrl = null;
- this.Configuration.WebsiteUrl = null;
- }
-
- var teamsTab = new Microsoft.Graph.TeamsTab()
- {
- DisplayName = this.DisplayName,
- ODataBind = this.TeamsAppId,
- Configuration = this.Configuration
- };
-
- return teamsTab;
- }
- }
-
-}
diff --git a/samples/Web.cs b/samples/Web.cs
deleted file mode 100644
index 6c69497..0000000
--- a/samples/Web.cs
+++ /dev/null
@@ -1,100 +0,0 @@
-using Azure.Identity;
-using Microsoft.Extensions.Options;
-using Microsoft.Graph;
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Threading.Tasks;
-
-namespace Graph.Community.Samples
-{
- public class Web
- {
- private readonly AzureAdSettings azureAdSettings;
- private readonly SharePointSettings sharePointSettings;
-
- public Web(
- IOptions azureAdOptions,
- IOptions sharePointOptions)
- {
- this.azureAdSettings = azureAdOptions.Value;
- this.sharePointSettings = sharePointOptions.Value;
- }
-
- public async Task Run()
- {
- //////////////////////
- //
- // TokenCredential
- //
- //////////////////////
-
- var credential = new ChainedTokenCredential(
- new SharedTokenCacheCredential(new SharedTokenCacheCredentialOptions() { TenantId = azureAdSettings.TenantId, ClientId = azureAdSettings.ClientId }),
- new VisualStudioCredential(new VisualStudioCredentialOptions { TenantId = azureAdSettings.TenantId }),
- new InteractiveBrowserCredential(new InteractiveBrowserCredentialOptions { TenantId = azureAdSettings.TenantId, ClientId = azureAdSettings.ClientId })
- );
-
-
- ////////////////////////////////////////////////////////////
- //
- // Graph Client with Logger and SharePoint service handler
- //
- ////////////////////////////////////////////////////////////
-
- var logger = new StringBuilderHttpMessageLogger();
- /*
- * Could also use the Console if preferred...
- *
- * var logger = new ConsoleHttpMessageLogger();
- */
-
- // Configure our client
- CommunityGraphClientOptions clientOptions = new CommunityGraphClientOptions()
- {
- UserAgent = "SiteGroupsSample"
- };
- var graphServiceClient = CommunityGraphClientFactory.Create(clientOptions, logger, credential);
-
- ///////////////////////////////////////
- //
- // Setup is complete, run the sample
- //
- ///////////////////////////////////////
-
- var scopes = new string[] { $"https://{sharePointSettings.Hostname}/AllSites.FullControl" };
- var WebUrl = $"https://{sharePointSettings.Hostname}{sharePointSettings.SiteCollectionUrl}";
-
- try
- {
- var web = await graphServiceClient
- .SharePointAPI(WebUrl)
- .Web
- .Request()
- .WithScopes(scopes)
- .GetAsync();
-
-
- Console.WriteLine($"{web.Title} - {web.Id} - {web.WelcomePage}");
-
- var siteAssets = await graphServiceClient
- .SharePointAPI(WebUrl)
- .Web
- .Request()
- .WithScopes(scopes)
- .EnsureSiteAssetsAsync();
- }
- catch (Exception ex)
- {
- Console.WriteLine(ex.Message);
- }
-
-
- Console.WriteLine("Press enter to show log");
- Console.ReadLine();
- Console.WriteLine();
- var log = logger.GetLog();
- Console.WriteLine(log);
- }
- }
-}
diff --git a/samples/YammerReports.cs b/samples/YammerReports.cs
deleted file mode 100644
index a8ea312..0000000
--- a/samples/YammerReports.cs
+++ /dev/null
@@ -1,92 +0,0 @@
-using Azure.Identity;
-using Microsoft.Extensions.Options;
-using Microsoft.Graph;
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Threading.Tasks;
-
-namespace Graph.Community.Samples
-{
- public class YammerReports
- {
- private readonly AzureAdSettings azureAdSettings;
-
- public YammerReports(
- IOptions azureAdOptions)
- {
- this.azureAdSettings = azureAdOptions.Value;
- }
-
- public async Task Run()
- {
- //////////////////////
- //
- // TokenCredential
- //
- //////////////////////
-
- var credential = new ChainedTokenCredential(
- new SharedTokenCacheCredential(new SharedTokenCacheCredentialOptions() { TenantId = azureAdSettings.TenantId, ClientId = azureAdSettings.ClientId }),
- new VisualStudioCredential(new VisualStudioCredentialOptions { TenantId = azureAdSettings.TenantId }),
- new InteractiveBrowserCredential(new InteractiveBrowserCredentialOptions { TenantId = azureAdSettings.TenantId, ClientId = azureAdSettings.ClientId })
- );
-
- ////////////////////////////////////////////////////////////
- //
- // Graph Client with Logger and SharePoint service handler
- //
- ////////////////////////////////////////////////////////////
-
- var logger = new StringBuilderHttpMessageLogger();
-
- // Configure our client
- CommunityGraphClientOptions clientOptions = new CommunityGraphClientOptions()
- {
- UserAgent = "YammerReports"
- };
-
- var graphServiceClient = CommunityGraphClientFactory.Create(clientOptions, logger, credential);
-
- ///////////////////////////////////////
- //
- // Setup is complete, run the sample
- //
- ///////////////////////////////////////
-
- var scopes = new string[] { "Reports.Read.All" };
-
- try
- {
- var report = await graphServiceClient.Reports
- .GetYammerGroupsActivityCounts("D30")
- .Request()
- .WithScopes(scopes)
- .GetAsync();
-
- //var requestMessage = graphServiceClient.Reports
- // .GetYammerGroupsActivityCounts("D30")
- // .Request()
- // .WithScopes(scopes)
- // .GetHttpRequestMessage();
-
-
- //Console.WriteLine(report.ODataType);
- }
- catch (Exception ex)
- {
-
- }
-
-
- Console.WriteLine();
- Console.WriteLine("Press enter to show log");
- Console.ReadLine();
- Console.WriteLine();
- var log = logger.GetLog();
- Console.WriteLine(log);
-
- }
-
- }
-}