├── .editorconfig
├── .github
├── CODEOWNERS
├── policies
│ ├── msgraph-sdk-dotnet-contrib-branch-protection
│ └── resourceManagement.yml
└── workflows
│ ├── build.yml
│ ├── codeql.yml
│ └── deploy.yml
├── .gitignore
├── CONTRIBUTING.md
├── Graph.Community.sln
├── LICENSE
├── README.md
├── azure-pipelines.yml
├── docs
├── Graph-Community-NuGet.png
└── ROADMAP.md
├── samples
├── AppRegPublicClient.png
├── ChangeLog.cs
├── ConsoleHostedService.cs
├── Diagnostics.cs
├── DiagnosticsILogger.cs
├── ExpiringClientSecrets.cs
├── Graph.Community.Samples.csproj
├── Graph.Community.Samples.sln
├── GraphGroupExtensions.cs
├── ImmutableIds.cs
├── InteractiveLoginAppReg.png
├── MenuService.cs
├── Program.cs
├── README.md
├── RootSite.cs
├── SharePointAPIPermissions.png
├── SharePointSearch.cs
├── SiteDesign.cs
├── SiteGroups.cs
├── SitePages.cs
├── Utilities
│ ├── AzureAdSettings.cs
│ ├── ConsoleHttpMessageLogger.cs
│ ├── DotNetILoggerHttpMessageLogger.cs
│ ├── DotNetILoggerSettings.cs
│ ├── SharePointSettings.cs
│ ├── StringBuilderHttpMessageLogger.cs
│ └── TokenCacheHelper.cs
└── appSettings.json
├── src
├── .editorconfig
├── CommunityGraphClientFactory.cs
├── CommunityGraphClientOptions.cs
├── CommunityGraphConstants.cs
├── CommunityGraphTelemetry.cs
├── Diagnostics
│ ├── GraphCommunityEventSource.cs
│ └── GraphCommunityEventSourceListener.cs
├── Extensions
│ ├── BaseRequestBuilderExtensions.cs
│ ├── BaseRequestExtensions.cs
│ ├── GraphGroupExtensions.cs
│ ├── GraphServiceClientExtensions.cs
│ ├── RequestExtensionsConstants.cs
│ └── UserRequestBuilderExtensions.cs
├── Graph.Community.csproj
├── Middleware
│ ├── HttpMessageFormatter.cs
│ ├── IHttpMessageLogger.cs
│ ├── LoggingMessageHandler.cs
│ ├── NullHttpMessageLogger.cs
│ ├── Options
│ │ └── SharePointServiceHandlerOption.cs
│ └── SharePointServiceHandler.cs
├── Models
│ ├── AppTile.cs
│ ├── ChangeLog
│ │ ├── Change.cs
│ │ ├── ChangeItem.cs
│ │ ├── ChangeList.cs
│ │ ├── ChangeQuery.cs
│ │ ├── ChangeSite.cs
│ │ ├── ChangeToken.cs
│ │ ├── ChangeType.cs
│ │ ├── ChangeUser.cs
│ │ └── ChangeWeb.cs
│ ├── Form.cs
│ ├── Group.cs
│ ├── HttpMessages
│ │ ├── ApplySiteDesignRequest.cs
│ │ ├── ApplySiteDesignResponse.cs
│ │ ├── CreateSiteDesignRequest.cs
│ │ ├── GetChangesRequest.cs
│ │ ├── SiteDesignRequestInfo.cs
│ │ ├── SiteScriptRequestInfo.cs
│ │ ├── StorageEntitiesResponse.cs
│ │ ├── TenantSettingsResponse.cs
│ │ ├── UpdateSiteDesignRequest.cs
│ │ └── UpdateSiteScriptRequest.cs
│ ├── List.cs
│ ├── ListField
│ │ ├── Field.cs
│ │ ├── FieldChoice.cs
│ │ ├── FieldDateTime.cs
│ │ ├── FieldLookup.cs
│ │ ├── FieldMultiChoice.cs
│ │ ├── FieldMultiLineText.cs
│ │ ├── FieldNumber.cs
│ │ ├── FieldTaxonomy.cs
│ │ ├── FieldText.cs
│ │ ├── FieldUrl.cs
│ │ └── FieldUser.cs
│ ├── ListItem.cs
│ ├── Navigation.cs
│ ├── NavigationNode.cs
│ ├── NavigationNodeCreationInformation.cs
│ ├── Principal.cs
│ ├── RegionalSettings.cs
│ ├── SPPrincipalType.cs
│ ├── SearchQuery.cs
│ ├── SearchResult.cs
│ ├── Site.cs
│ ├── SiteDesignMetadata.cs
│ ├── SiteDesignRun.cs
│ ├── SitePage.cs
│ ├── SitePageCheckoutType.cs
│ ├── SitePageFileInfo.cs
│ ├── SitePageModerationStatus.cs
│ ├── SitePagePromotedState.cs
│ ├── SitePagePublishedStatus.cs
│ ├── SitePageVersion.cs
│ ├── SiteScriptMetadata.cs
│ ├── StorageEntity.cs
│ ├── User.cs
│ ├── UserInfo.cs
│ └── Web.cs
├── README.md
├── Requests
│ ├── AppCatalog
│ │ ├── AppCatalogUrlRequest.cs
│ │ ├── AppCatalogUrlRequestBuilder.cs
│ │ ├── IAppCatalogUrlRequest.cs
│ │ └── IAppCatalogUrlRequestBuilder.cs
│ ├── AppTiles
│ │ ├── AppTileCollectionPage.cs
│ │ ├── AppTileCollectionRequest.cs
│ │ ├── AppTileCollectionRequestBuilder.cs
│ │ ├── IAppTileCollectionPage.cs
│ │ ├── IAppTileCollectionRequest.cs
│ │ └── IAppTileCollectionRequestBuilder.cs
│ ├── BaseSharePointAPIRequest.cs
│ ├── ChangeLog
│ │ ├── ChangeLogCollectionPage.cs
│ │ ├── ChangeLogRequest.cs
│ │ └── IChangeLogCollectionPage.cs
│ ├── ISharePointAPIRequestBuilder.cs
│ ├── List
│ │ ├── IListCollectionPage.cs
│ │ ├── IListCollectionRequest.cs
│ │ ├── IListCollectionRequestBuilder.cs
│ │ ├── IListRequest.cs
│ │ ├── IListRequestBuilder.cs
│ │ ├── ListCollectionPage.cs
│ │ ├── ListCollectionRequest.cs
│ │ ├── ListCollectionRequestBuilder.cs
│ │ ├── ListRequest.cs
│ │ └── ListRequestBuilder.cs
│ ├── ListField
│ │ ├── IListFieldCollectionPage.cs
│ │ ├── IListFieldCollectionRequest.cs
│ │ ├── IListFieldCollectionRequestBuilder.cs
│ │ ├── IListFieldRequest.cs
│ │ ├── IListFieldRequestBuilder.cs
│ │ ├── ListFieldCollectionPage.cs
│ │ ├── ListFieldCollectionRequest.cs
│ │ ├── ListFieldCollectionRequestBuilder.cs
│ │ ├── ListFieldRequest.cs
│ │ └── ListFieldRequestBuilder.cs
│ ├── ListItem
│ │ ├── IListItemCollectionPage.cs
│ │ ├── IListItemCollectionRequest.cs
│ │ ├── IListItemCollectionRequestBuilder.cs
│ │ ├── IListItemRequest.cs
│ │ ├── IListItemRequestBuilder.cs
│ │ ├── ListItemCollectionPage.cs
│ │ ├── ListItemCollectionRequest.cs
│ │ ├── ListItemCollectionRequestBuilder.cs
│ │ ├── ListItemRequest.cs
│ │ └── ListItemRequestBuilder.cs
│ ├── Navigation
│ │ ├── INavigationNodeCollectionPage.cs
│ │ ├── INavigationNodeCollectionRequest.cs
│ │ ├── INavigationNodeCollectionRequestBuilder.cs
│ │ ├── INavigationNodeRequest.cs
│ │ ├── INavigationNodeRequestBuilder.cs
│ │ ├── INavigationRequest.cs
│ │ ├── INavigationRequestBuilder.cs
│ │ ├── NavigationNodeCollectionPage.cs
│ │ ├── NavigationNodeCollectionRequest.cs
│ │ ├── NavigationNodeCollectionRequestBuilder.cs
│ │ ├── NavigationNodeRequest.cs
│ │ ├── NavigationNodeRequestBuilder.cs
│ │ ├── NavigationRequest.cs
│ │ └── NavigationRequestBuilder.cs
│ ├── Search
│ │ ├── ISearchRequest.cs
│ │ ├── ISearchRequestBuilder.cs
│ │ ├── SearchRequest.cs
│ │ └── SearchRequestBuilder.cs
│ ├── SharePointAPICollectionResponse.cs
│ ├── SharePointAPIRequestBuilder.cs
│ ├── SharePointAPIRequestConstants.cs
│ ├── Site
│ │ ├── ISiteRequest.cs
│ │ ├── ISiteRequestBuilder.cs
│ │ ├── SiteRequest.cs
│ │ └── SiteRequestBuilder.cs
│ ├── SiteDesign
│ │ ├── ApplySiteDesignActionOutcomeCollectionPage.cs
│ │ ├── IApplySiteDesignActionOutcomeCollectionPage.cs
│ │ ├── ISiteDesignCollectionPage.cs
│ │ ├── ISiteDesignCollectionRequest.cs
│ │ ├── ISiteDesignCollectionRequestBuilder.cs
│ │ ├── ISiteDesignRequest.cs
│ │ ├── ISiteDesignRequestBuilder.cs
│ │ ├── ISiteDesignRunCollectionPage.cs
│ │ ├── ISiteDesignRunRequest.cs
│ │ ├── ISiteDesignRunRequestBuilder.cs
│ │ ├── SiteDesignCollectionPage.cs
│ │ ├── SiteDesignCollectionRequest.cs
│ │ ├── SiteDesignCollectionRequestBuilder.cs
│ │ ├── SiteDesignRequest.cs
│ │ ├── SiteDesignRequestBuilder.cs
│ │ ├── SiteDesignRunCollectionPage.cs
│ │ ├── SiteDesignRunRequest.cs
│ │ └── SiteDesignRunRequestBuilder.cs
│ ├── SiteGroups
│ │ ├── ISiteGroupCollectionPage.cs
│ │ ├── ISiteGroupCollectionRequest.cs
│ │ ├── ISiteGroupCollectionRequestBuilder.cs
│ │ ├── ISiteGroupRequest.cs
│ │ ├── ISiteGroupRequestBuilder.cs
│ │ ├── SiteGroupCollectionPage.cs
│ │ ├── SiteGroupCollectionRequest.cs
│ │ ├── SiteGroupCollectionRequestBuilder.cs
│ │ ├── SiteGroupRequest.cs
│ │ └── SiteGroupRequestBuilder.cs
│ ├── SitePages
│ │ ├── ISitePageCollectionPage.cs
│ │ ├── ISitePageCollectionRequest.cs
│ │ ├── ISitePageCollectionRequestBuilder.cs
│ │ ├── ISitePageRequest.cs
│ │ ├── ISitePageRequestBuilder.cs
│ │ ├── ISitePageVersionCollectionPage.cs
│ │ ├── ISitePageVersionCollectionRequest.cs
│ │ ├── ISitePageVersionCollectionRequestBuilder.cs
│ │ ├── SitePageCollectionPage.cs
│ │ ├── SitePageCollectionRequest.cs
│ │ ├── SitePageCollectionRequestBuilder.cs
│ │ ├── SitePageRequest.cs
│ │ ├── SitePageRequestBuilder.cs
│ │ ├── SitePageVersionCollectionPage.cs
│ │ ├── SitePageVersionCollectionRequest.cs
│ │ └── SitePageVersionCollectionRequestBuilder.cs
│ ├── SiteScript
│ │ ├── ISiteScriptCollectionPage.cs
│ │ ├── ISiteScriptCollectionRequest.cs
│ │ ├── ISiteScriptCollectionRequestBuilder.cs
│ │ ├── ISiteScriptRequest.cs
│ │ ├── ISiteScriptRequestBuilder.cs
│ │ ├── SiteScriptCollectionPage.cs
│ │ ├── SiteScriptCollectionRequest.cs
│ │ ├── SiteScriptCollectionRequestBuilder.cs
│ │ ├── SiteScriptRequest.cs
│ │ └── SiteScriptRequestBuilder.cs
│ ├── SiteUsers
│ │ ├── ISiteUserCollectionPage.cs
│ │ ├── ISiteUserCollectionRequest.cs
│ │ ├── ISiteUserCollectionRequestBuilder.cs
│ │ ├── ISiteUserRequest.cs
│ │ ├── ISiteUserRequestBuilder.cs
│ │ ├── SiteUserCollectionPage.cs
│ │ ├── SiteUserCollectionRequest.cs
│ │ ├── SiteUserCollectionRequestBuilder.cs
│ │ ├── SiteUserRequest.cs
│ │ └── SiteUserRequestBuilder.cs
│ ├── StorageEntity
│ │ ├── IStorageEntityCollectionRequest.cs
│ │ ├── IStorageEntityCollectionRequestBuilder.cs
│ │ ├── IStorageEntityRequest.cs
│ │ ├── IStorageEntityRequestBuilder.cs
│ │ ├── StorageEntityCollectionRequest.cs
│ │ ├── StorageEntityCollectionRequestBuilder.cs
│ │ ├── StorageEntityRequest.cs
│ │ └── StorageEntityRequestBuilder.cs
│ ├── Tenant
│ │ ├── ITenantRequestBuilder.cs
│ │ └── TenantRequestBuilder.cs
│ ├── UserMailboxSettings
│ │ ├── IUserMailboxSettingsRequest.cs
│ │ ├── IUserMailboxSettingsRequestBuilder.cs
│ │ ├── UserMailboxSettingsRequest.cs
│ │ └── UserMailboxSettingsRequestBuilder.cs
│ └── Web
│ │ ├── IWebRequest.cs
│ │ ├── IWebRequestBuilder.cs
│ │ ├── WebRequest.cs
│ │ └── WebRequestBuilder.cs
├── Serializer
│ ├── SPChangeQueryConverter.cs
│ ├── SPDerivedTypeConverterAttribute.cs
│ ├── SPDerivedTypedConverter.cs
│ ├── SPEnumIntAsStringConverter.cs
│ ├── SPNavigationNodeConverter.cs
│ ├── SPODataTypeConverter.cs
│ └── SPSearchQueryConverter.cs
└── graph-community.png
└── test
├── BaseRequestBuilderExtensionTests.cs
├── BaseRequestExtensionTests.cs
├── BaseSharePointAPIRequestTests.cs
├── ChangeLogRequestTests.cs
├── ChangeQuerySerializationTests.cs
├── Graph.Community.Test.csproj
├── GraphGroupExtensionsTests.cs
├── ListCollectionRequestTests.cs
├── ListFieldCollectionRequestTests.cs
├── ListItemCollectionRequestTests.cs
├── ListItemRequestTests.cs
├── ListRequestTests.cs
├── LoggingMessageHandlerTests.cs
├── Mocks
├── ApplySiteDesignResponse.json
├── CreateSiteDesignResponse.json
├── CreateSiteScriptResponse.json
├── EnsureSiteAssetsResponse.json
├── EnsureUserResponse.json
├── GetChangesResponse.json
├── GetListFieldsResponse.json
├── GetListItemResponse.json
├── GetListItemsResponse.json
├── GetListResponse.json
├── GetListsResponse.json
├── GetSiteDesignMetadataResponse.json
├── GetSiteDesignRunsResponse.json
├── GetSiteDesignsResponse.json
├── GetSiteGroupsExpandUsersResponse.json
├── GetSiteGroupsResponse.json
├── GetSitePageResponse.json
├── GetSitePageVersionsResponse.json
├── GetSitePagesResponse.json
├── GetSiteResponse.json
├── GetSiteScriptMetadataResponse.json
├── GetSiteScriptsResponse.json
├── GetSiteUserResponse.json
├── GetSiteUsersResponse.json
├── GetStorageEntitiesResponse.json
├── GetTenantAppCatalogUrlResponse.json
├── GetUserMailboxSettingsResponse.json
├── GetWebAppTilesResponse.json
├── GetWebAssociatedGroupsResponse.json
├── GetWebAssociatedGroupsWithUsersResponse.json
├── GetWebResponse.json
├── GetWebSitePagesListResponse.json
├── MockAuthenticationProvider.cs
├── MockHttpProvider.cs
├── MockSharePointServiceHandler.cs
├── NavigationNodeCollectionResponse.json
├── SearchQueryResponse.json
├── TestGraphServiceClient.cs
├── TestResponseHandler.cs
├── TestSerializer.cs
├── UpdateSiteDesignResponse.json
├── UpdateSiteScriptResponse.json
└── WebAssociatedGroupResponse.json
├── ResourceManager.cs
├── SearchQueryModelTests.cs
├── SearchRequestTests.cs
├── SiteDesignCollectionRequestTests.cs
├── SiteDesignRequestTests.cs
├── SiteDesignRunRequestTests.cs
├── SitePageConverterTests.cs
├── SitePageFileInfoConverterTests.cs
├── SitePageRequestTests.cs
├── SitePagesCollectionRequestTests.cs
├── SiteRequestTests.cs
├── SiteScriptCollectionRequestTests.cs
├── SiteScriptRequestTests.cs
├── StorageEntityCollectionRequestTests.cs
├── StorageEntityRequestTests.cs
├── TenantAppCatalogUrlTests.cs
├── UserMailboxSettingsRequestTests.cs
├── WebAppTilesRequestTests.cs
├── WebNavigationRequestTests.cs
├── WebRequestTests.cs
├── WebSiteGroupsRequestTests.cs
└── WebSiteUsersRequestTests.cs
/.editorconfig:
--------------------------------------------------------------------------------
1 |
2 | [*]
3 | indent_style = spaces
4 | indent_size = 2
5 | charset = utf-8
6 | trim_trailing_whitespace = true
7 | insert_final_newline = true
8 |
--------------------------------------------------------------------------------
/.github/CODEOWNERS:
--------------------------------------------------------------------------------
1 | * @microsoftgraph/msgraph-sdk-dotnet-contrib-write
2 | * @pschaeflein
3 |
--------------------------------------------------------------------------------
/.github/workflows/build.yml:
--------------------------------------------------------------------------------
1 | name: 'Build'
2 |
3 | on:
4 | workflow_dispatch:
5 | push:
6 | branches:
7 | - graph-v4
8 | - master
9 | pull_request:
10 | branches:
11 | - graph-v4
12 | - master
13 |
14 | env:
15 | # Stop wasting time caching packages
16 | DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
17 | # Disable sending usage data to Microsoft
18 | DOTNET_CLI_TELEMETRY_OPTOUT: true
19 | # Project name to pack and publish
20 | PROJECT_NAME: Graph.Community
21 | # Official NuGet Feed settings
22 | NUGET_FEED: https://api.nuget.org/v3/index.json
23 | NUGET_APIKEY: ${{ secrets.NUGET_APIKEY }}
24 |
25 | jobs:
26 | build:
27 | runs-on: windows-latest
28 | steps:
29 | - name: Checkout
30 | uses: actions/checkout@v2
31 | - name: Setup .NET Core
32 | uses: actions/setup-dotnet@v1
33 | - name: Restore
34 | run: dotnet restore
35 | - name: Build
36 | run: dotnet build -c Release --no-restore
37 | - name: Test
38 | run: dotnet test -c Release
39 |
40 |
41 |
--------------------------------------------------------------------------------
/.github/workflows/deploy.yml:
--------------------------------------------------------------------------------
1 | name: Deploy NuGet
2 |
3 | on:
4 | release:
5 | types: [ published ]
6 |
7 | env:
8 | # Stop wasting time caching packages
9 | DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
10 | # Disable sending usage data to Microsoft
11 | DOTNET_CLI_TELEMETRY_OPTOUT: true
12 | # Project name to pack and publish
13 | PROJECT_NAME: Graph.Community
14 | # Official NuGet Feed settings
15 | NUGET_FEED: https://api.nuget.org/v3/index.json
16 | NUGET_APIKEY: ${{ secrets.NUGET_APIKEY }}
17 |
18 | jobs:
19 | deploy:
20 | if: github.event_name == 'release'
21 | runs-on: windows-latest
22 | steps:
23 | - uses: actions/checkout@v2
24 | - name: Setup .NET Core
25 | uses: actions/setup-dotnet@v1
26 | - name: Create Release NuGet package
27 | run: |
28 | $VERSION=($env:GITHUB_REF -split "/" | select -skip 2).TrimStart("v")
29 | echo Version: $VERSION
30 | dotnet pack -v normal -c Release --include-source -p:PackageVersion=$VERSION -p:Version=$VERSION -o nupkg src/$env:PROJECT_NAME.csproj
31 | - name: Push to NuGet Feed
32 | run: dotnet nuget push **\*.nupkg --source $env:NUGET_FEED --skip-duplicate --api-key $env:NUGET_APIKEY
33 |
--------------------------------------------------------------------------------
/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 | # Contributing to the Graph.Community Library
2 | Thanks for considering making a contribution! Read over our guidelines and we will do our best to see your PRs merged successfully.
3 |
4 | There are a few different recommended paths to get contributions into the released version of this library.
5 |
6 | ## File issues
7 | The best way to get started with a contribution is to start a dialog with us. Sometimes features will be under development or out of scope for this library and it's best to check before starting work on contribution, especially for large work items.
8 |
9 | ## Pull requests
10 | All pull requests should be submitted against the **prerelease** branch. The master branch is intended to represent the code released in the most-recent Nuget package.
11 |
12 | When a new package is about to be released, changes in dev will be merged into master. The package will be generated from master.
13 |
14 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2019 Microsoft Graph
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/docs/Graph-Community-NuGet.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoftgraph/msgraph-sdk-dotnet-contrib/c02dfeed814378bf49d9bbc80e8a1995a8c87ead/docs/Graph-Community-NuGet.png
--------------------------------------------------------------------------------
/samples/AppRegPublicClient.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoftgraph/msgraph-sdk-dotnet-contrib/c02dfeed814378bf49d9bbc80e8a1995a8c87ead/samples/AppRegPublicClient.png
--------------------------------------------------------------------------------
/samples/Graph.Community.Samples.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Exe
5 | net7.0
6 | 68071ad2-6ee0-41d1-ad86-2635c69bfadf
7 | Debug;Prerelease;LocalDev
8 | latest
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 | PreserveNewest
35 |
36 |
37 | PreserveNewest
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
--------------------------------------------------------------------------------
/samples/InteractiveLoginAppReg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoftgraph/msgraph-sdk-dotnet-contrib/c02dfeed814378bf49d9bbc80e8a1995a8c87ead/samples/InteractiveLoginAppReg.png
--------------------------------------------------------------------------------
/samples/SharePointAPIPermissions.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoftgraph/msgraph-sdk-dotnet-contrib/c02dfeed814378bf49d9bbc80e8a1995a8c87ead/samples/SharePointAPIPermissions.png
--------------------------------------------------------------------------------
/samples/Utilities/AzureAdSettings.cs:
--------------------------------------------------------------------------------
1 | namespace Graph.Community.Samples
2 | {
3 | public class AzureAdSettings
4 | {
5 | public const string ConfigurationSectionName = "AzureAd";
6 | public string TenantId { get; set; }
7 | public string ClientId { get; set; }
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/samples/Utilities/ConsoleHttpMessageLogger.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Threading.Tasks;
3 |
4 | namespace Graph.Community.Samples
5 | {
6 | class ConsoleHttpMessageLogger : IHttpMessageLogger
7 | {
8 | public async Task WriteLine(string value)
9 | {
10 | Console.WriteLine(value);
11 | }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/samples/Utilities/DotNetILoggerHttpMessageLogger.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Extensions.Logging;
2 | using Microsoft.Extensions.Options;
3 | using System.Threading.Tasks;
4 |
5 | namespace Graph.Community.Samples
6 | {
7 | public class DotNetILoggerHttpMessageLogger : IHttpMessageLogger
8 | {
9 | private readonly ILogger logger;
10 | private readonly LogLevel logLevel;
11 |
12 | public DotNetILoggerHttpMessageLogger(
13 | ILogger logger,
14 | IOptions dotNetILoggerOptions)
15 | {
16 | this.logger = logger;
17 | this.logLevel = dotNetILoggerOptions?.Value?.LogLevel ?? LogLevel.Trace;
18 | }
19 |
20 | public async Task WriteLine(string message)
21 | {
22 | logger.Log(logLevel, message);
23 | }
24 |
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/samples/Utilities/DotNetILoggerSettings.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Extensions.Logging;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Text;
5 |
6 | namespace Graph.Community.Samples
7 | {
8 | public class DotNetILoggerSettings
9 | {
10 | public LogLevel LogLevel { get; set; }
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/samples/Utilities/SharePointSettings.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 |
5 | namespace Graph.Community.Samples
6 | {
7 | public class SharePointSettings
8 | {
9 | public const string ConfigurationSectionName = "SharePoint";
10 |
11 | public string Hostname { get; set; }
12 | public string SiteCollectionUrl { get; set; }
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/samples/Utilities/StringBuilderHttpMessageLogger.cs:
--------------------------------------------------------------------------------
1 | using System.Text;
2 | using System.Threading.Tasks;
3 |
4 | namespace Graph.Community.Samples
5 | {
6 | class StringBuilderHttpMessageLogger : IHttpMessageLogger
7 | {
8 | private readonly StringBuilder sb = new StringBuilder();
9 |
10 | public string GetLog()
11 | {
12 | var log = sb.ToString();
13 | sb.Clear();
14 | return log;
15 | }
16 |
17 | public async Task WriteLine(string value)
18 | {
19 | sb.AppendLine(value);
20 | }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/samples/appSettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "AzureAd": {
3 | "TenantId": "",
4 | "ClientId": ""
5 | },
6 | "SharePoint": {
7 | "Hostname": "demo.sharepoint.com",
8 | "SiteCollectionUrl": "/sites/GraphCommunityTest"
9 | },
10 | "Logging": {
11 | "Console": {
12 | "LogLevel": {
13 | "Microsoft.Hosting.Lifetime": "Warning"
14 | }
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/src/CommunityGraphClientOptions.cs:
--------------------------------------------------------------------------------
1 | using System.Net.Http.Headers;
2 |
3 | namespace Graph.Community
4 | {
5 | public class CommunityGraphClientOptions
6 | {
7 | ///
8 | /// Set to true to disable telemetry
9 | ///
10 | public bool DisableTelemetry { get; set; }
11 | ///
12 | /// The UserAgent to set on requests. Overridden by
13 | ///
14 | public string UserAgent { get; set; }
15 | ///
16 | /// The UserAgentInfo for decorating SharePoint traffice. Overrides
17 | ///
18 | public SharePointThrottlingDecoration UserAgentInfo { get; set; }
19 |
20 | public CommunityGraphClientOptions() { }
21 | public CommunityGraphClientOptions(string companyName, string appName, string appVersion, bool isv)
22 | {
23 | this.UserAgentInfo = new SharePointThrottlingDecoration()
24 | {
25 | CompanyName = companyName,
26 | AppName = appName,
27 | AppVersion = appVersion,
28 | ISV = isv
29 | };
30 | }
31 | }
32 |
33 | public struct SharePointThrottlingDecoration
34 | {
35 | public string CompanyName { get; set; }
36 | public string AppName { get; set; }
37 | public string AppVersion { get; set; }
38 | public bool ISV { get; set; }
39 |
40 | public bool IsEmpty()
41 | {
42 | return string.IsNullOrEmpty(CompanyName) &&
43 | string.IsNullOrEmpty(AppName) &&
44 | string.IsNullOrEmpty(AppName) &&
45 | !ISV;
46 | }
47 |
48 | public ProductInfoHeaderValue ToUserAgent()
49 | {
50 | var isvDecoration = ISV ? "ISV" : "NONISV";
51 | var product = $"{isvDecoration}|{CompanyName}|{AppName}";
52 | return new ProductInfoHeaderValue(product, AppVersion);
53 | }
54 | }
55 |
56 | }
57 |
--------------------------------------------------------------------------------
/src/CommunityGraphConstants.cs:
--------------------------------------------------------------------------------
1 | namespace Graph.Community
2 | {
3 | public static class CommunityGraphConstants
4 | {
5 | public static class Library
6 | {
7 | /// The key for the SDK version header.
8 | internal static readonly string VersionHeaderName = CommunityGraphConstants.Headers.CommunityLibraryVersionHeaderName;
9 |
10 | /// The version for current assembly.
11 | internal static string AssemblyVersion = System.Diagnostics.FileVersionInfo.GetVersionInfo(typeof(CommunityGraphConstants).Assembly.Location).FileVersion;
12 |
13 | /// The value for the SDK version header.
14 | internal static string VersionHeaderValue = $"dotnet-{AssemblyVersion}";
15 | }
16 |
17 | public static class Serialization
18 | {
19 | internal const string ODataType = "odata.type";
20 | }
21 |
22 | public static class Headers
23 | {
24 | /// Library Version header
25 | public const string CommunityLibraryVersionHeaderName = "CommunityLibraryVersion";
26 |
27 | /// Library Version header
28 | public const string CommunityLibraryVersionHeaderValueFormatString = "dotnet-{0}.{1}.{2}";
29 | }
30 |
31 | public static class TelemetryProperties
32 | {
33 | public const string ResourceUri = nameof(ResourceUri);
34 | public const string RequestMethod = nameof(RequestMethod);
35 | public const string ClientRequestId = nameof(ClientRequestId);
36 | public const string ResponseStatus = nameof(ResponseStatus);
37 | public const string RawErrorResponse = nameof(RawErrorResponse);
38 | public const string AuthenticationProvider = nameof(AuthenticationProvider);
39 | public const string TokenCredential = nameof(TokenCredential);
40 | public const string LoggingHandler = nameof(LoggingHandler);
41 | public const string ExtensionMethod = nameof(ExtensionMethod);
42 | }
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/src/Extensions/BaseRequestBuilderExtensions.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Microsoft.Graph;
3 |
4 | namespace Graph.Community
5 | {
6 | public static class BaseRequestBuilderExtensions
7 | {
8 | ///
9 | /// Returns the Path to use for the Resource property of Subscription object when creating a new subscription
10 | ///
11 | /// Current request builder
12 | /// URL to use for the Resource property of Subscription object when creating a new subscription
13 | public static string GetResourceSubscriptionPath(this IBaseRequestBuilder requestBuilder)
14 | {
15 | if (requestBuilder is null)
16 | {
17 | throw new ArgumentNullException(nameof(requestBuilder));
18 | }
19 |
20 | var pathAndQuery = new Uri(requestBuilder.RequestUrl).PathAndQuery;
21 | return pathAndQuery.Substring(pathAndQuery.IndexOf('/', 1)); //skips first / to ignore the version
22 | }
23 |
24 | ///
25 | /// Applies an OData cast filter to the returned collection.
26 | ///
27 | ///
28 | /// Current request builder
29 | /// The OData type name
30 | /// Request builder with OData cast filter applied
31 | public static T WithODataCast(this T requestBuilder, string oDataCast) where T : IBaseRequestBuilder
32 | {
33 | if (requestBuilder is null)
34 | {
35 | throw new ArgumentNullException(nameof(requestBuilder));
36 | }
37 |
38 | if (string.IsNullOrEmpty(oDataCast))
39 | {
40 | throw new ArgumentException($"'{nameof(oDataCast)}' cannot be null or empty.", nameof(oDataCast));
41 | }
42 |
43 | var updatedUrl = requestBuilder.AppendSegmentToRequestUrl(oDataCast);
44 | var updatedBuilder = (T)Activator.CreateInstance(requestBuilder.GetType(), updatedUrl, requestBuilder.Client);
45 |
46 | return updatedBuilder;
47 | }
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/src/Extensions/BaseRequestExtensions.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Microsoft.Graph;
3 |
4 | namespace Graph.Community
5 | {
6 | public static class BaseRequestExtensions
7 | {
8 | ///
9 | /// Adds the Prefer header to include Immutable Ids in the response
10 | ///
11 | ///
12 | /// The for the request.
13 | ///
14 | public static T WithImmutableId(this T baseRequest) where T : IBaseRequest
15 | {
16 | if (baseRequest is null)
17 | {
18 | throw new ArgumentNullException(nameof(baseRequest));
19 | }
20 |
21 | baseRequest.Headers.Add(
22 | new HeaderOption(
23 | RequestExtensionsConstants.Headers.PreferHeaderName,
24 | RequestExtensionsConstants.Headers.PreferHeaderImmutableIdValue)
25 | );
26 | return baseRequest;
27 | }
28 |
29 | ///
30 | /// Applies the ConsistencyLevel header required for certain DirectoryObject queries.
31 | /// (https://developer.microsoft.com/en-us/office/blogs/microsoft-graph-advanced-queries-for-directory-objects-are-now-generally-available/)
32 | ///
33 | ///
34 | /// The for the request.
35 | ///
36 | public static T WithEventualConsistency(this T baseRequest) where T : IBaseRequest
37 | {
38 | if (baseRequest is null)
39 | {
40 | throw new ArgumentNullException(nameof(baseRequest));
41 | }
42 |
43 | baseRequest.Headers.Add(
44 | new HeaderOption(
45 | RequestExtensionsConstants.Headers.ConsistencyLevelHeaderName,
46 | RequestExtensionsConstants.Headers.ConsistencyLevelEventualValue)
47 | );
48 | return baseRequest;
49 | }
50 | }
51 | }
52 |
--------------------------------------------------------------------------------
/src/Extensions/GraphServiceClientExtensions.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Microsoft.Graph;
3 |
4 | namespace Graph.Community
5 | {
6 | public static class GraphServiceClientExtensions
7 | {
8 | public static ISharePointAPIRequestBuilder SharePointAPI(this GraphServiceClient graphServiceClient, string siteUrl)
9 | {
10 | if (graphServiceClient is null)
11 | {
12 | throw new ArgumentNullException(nameof(graphServiceClient));
13 | }
14 |
15 | if (string.IsNullOrEmpty(siteUrl))
16 | {
17 | throw new System.ArgumentException($"'{nameof(siteUrl)}' cannot be null or empty.", nameof(siteUrl));
18 | }
19 |
20 | return new SharePointAPIRequestBuilder(siteUrl, graphServiceClient);
21 | }
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/src/Extensions/RequestExtensionsConstants.cs:
--------------------------------------------------------------------------------
1 | namespace Graph.Community
2 | {
3 | public static class RequestExtensionsConstants
4 | {
5 | #pragma warning disable CA1034 // Nested types should not be visible
6 | #pragma warning disable CA1724 // Type names should not match namespaces
7 |
8 | public static class Headers
9 | {
10 | public const string PreferHeaderName = "Prefer";
11 | public const string PreferHeaderImmutableIdValue = "IdType=\"ImmutableId\"";
12 |
13 | public const string ConsistencyLevelHeaderName = "ConsistencyLevel";
14 | public const string ConsistencyLevelEventualValue = "eventual";
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/src/Extensions/UserRequestBuilderExtensions.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Microsoft.Graph;
3 |
4 | namespace Graph.Community
5 | {
6 | public static class UserRequestBuilderExtensions
7 | {
8 | public static IUserMailboxSettingsRequestBuilder MailboxSettings(this IUserRequestBuilder builder)
9 | {
10 | if (builder is null)
11 | {
12 | throw new ArgumentNullException(nameof(builder));
13 | }
14 |
15 | return new UserMailboxSettingsRequestBuilder(builder.AppendSegmentToRequestUrl("mailboxSettings"), builder.Client);
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/src/Graph.Community.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | latest
5 | netstandard2.0
6 | false
7 | README.md
8 | MIT
9 | https://github.com/microsoftgraph/msgraph-sdk-dotnet-contrib
10 | graph-community.png
11 | https://github.com/microsoftgraph/msgraph-sdk-dotnet-contrib
12 | graph community extensions dotnetcore
13 | Community Extensions to Graph SDK
14 | true
15 | true
16 | embedded
17 |
18 |
19 |
20 | true
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
--------------------------------------------------------------------------------
/src/Middleware/IHttpMessageLogger.cs:
--------------------------------------------------------------------------------
1 | using System.Threading.Tasks;
2 |
3 | namespace Graph.Community
4 | {
5 | public interface IHttpMessageLogger
6 | {
7 | Task WriteLine(string value);
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/src/Middleware/LoggingMessageHandler.cs:
--------------------------------------------------------------------------------
1 | using System.Diagnostics;
2 | using System.Net.Http;
3 | using System.Threading;
4 | using System.Threading.Tasks;
5 |
6 | namespace Graph.Community
7 | {
8 | public class LoggingMessageHandler : DelegatingHandler
9 | {
10 | private readonly IHttpMessageLogger logger;
11 |
12 | public LoggingMessageHandler()
13 | : this(null)
14 | {
15 | }
16 |
17 | public LoggingMessageHandler(IHttpMessageLogger logger, HttpMessageHandler innerHandler = null)
18 | {
19 | InnerHandler = innerHandler ?? new HttpClientHandler();
20 | this.logger = logger ?? new NullHttpMessageLogger();
21 | }
22 |
23 | protected override async Task SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
24 | {
25 | if (request.Content != null)
26 | {
27 | await request.Content.LoadIntoBufferAsync();
28 | }
29 |
30 | using (var messageFormatter = new HttpMessageFormatter(request))
31 | {
32 | await logger.WriteLine(await messageFormatter.ReadAsStringAsync());
33 | await logger.WriteLine("");
34 | }
35 |
36 | var stopWatch = new Stopwatch();
37 | stopWatch.Start();
38 |
39 | var response = await base.SendAsync(request, cancellationToken);
40 |
41 | stopWatch.Stop();
42 |
43 | if (response.Content != null)
44 | {
45 | await response.Content.LoadIntoBufferAsync();
46 | }
47 | using (var messageFormatter = new HttpMessageFormatter(response))
48 | {
49 | await logger.WriteLine(await messageFormatter.ReadAsStringAsync());
50 | await logger.WriteLine("");
51 | await logger.WriteLine("Roundtrip (ms): " + stopWatch.ElapsedMilliseconds);
52 | await logger.WriteLine("================================================");
53 | }
54 |
55 | return response;
56 | }
57 |
58 | }
59 | }
60 |
--------------------------------------------------------------------------------
/src/Middleware/NullHttpMessageLogger.cs:
--------------------------------------------------------------------------------
1 | using System.Threading.Tasks;
2 |
3 | namespace Graph.Community
4 | {
5 | class NullHttpMessageLogger : IHttpMessageLogger
6 | {
7 | public Task WriteLine(string value)
8 | {
9 | return Task.CompletedTask;
10 | }
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/src/Middleware/Options/SharePointServiceHandlerOption.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Graph;
2 |
3 | namespace Graph.Community
4 | {
5 | public class SharePointServiceHandlerOption : IMiddlewareOption
6 | {
7 | public bool DisableTelemetry { get; set; }
8 | public string ResourceUri { get; set; }
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/src/Models/ChangeLog/Change.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Diagnostics;
3 | using Microsoft.Graph;
4 |
5 | namespace Graph.Community
6 | {
7 | [DebuggerDisplay("{ODataType, nq}")]
8 | [SPDerivedTypeConverter(typeof(SPODataTypeConverter))]
9 | public class Change : BaseItem
10 | {
11 | public ChangeToken ChangeToken { get; set; }
12 | public ChangeType ChangeType { get; set; }
13 | public Guid SiteId { get; set; }
14 | public DateTime Time { get; set; }
15 |
16 | public Change()
17 | : base()
18 | {
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/src/Models/ChangeLog/ChangeItem.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Graph.Community
4 | {
5 | public class ChangeItem : Change
6 | {
7 | public int ItemId { get; set; }
8 | public string Editor { get; set; }
9 | public string EditorEmailHint { get; set; }
10 | public Guid ListId { get; set; }
11 | public Guid UniqueId { get; set; }
12 | public Guid WebId { get; set; }
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/src/Models/ChangeLog/ChangeList.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Graph.Community
4 | {
5 | public class ChangeList : Change
6 | {
7 | public int BaseTemplate { get; set; }
8 | public bool Hidden { get; set; }
9 | public Guid ListId { get; set; }
10 | public string Title { get; set; }
11 | public Guid WebId { get; set; }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/src/Models/ChangeLog/ChangeSite.cs:
--------------------------------------------------------------------------------
1 | namespace Graph.Community
2 | {
3 | public class ChangeSite : Change
4 | {
5 | public ChangeSite()
6 | : base()
7 | {
8 | }
9 |
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/src/Models/ChangeLog/ChangeToken.cs:
--------------------------------------------------------------------------------
1 | namespace Graph.Community
2 | {
3 | public class ChangeToken
4 | {
5 | public string StringValue { get; set; }
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/src/Models/ChangeLog/ChangeType.cs:
--------------------------------------------------------------------------------
1 | namespace Graph.Community
2 | {
3 | public enum ChangeType
4 | {
5 | NoChange,
6 | Add,
7 | Update,
8 | DeleteObject,
9 | Rename,
10 | MoveAway,
11 | MoveInto,
12 | Restore,
13 | RoleAdd,
14 | RoleDelete,
15 | RoleUpdate,
16 | AssignmentAdd,
17 | AssignmentDelete,
18 | MemberAdd,
19 | MemberDelete,
20 | SystemUpdate,
21 | Navigation,
22 | ScopeAdd,
23 | ScopeDelete,
24 | ListContentTypeAdd,
25 | ListContentTypeDelete,
26 | Dirty,
27 | Activity
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/src/Models/ChangeLog/ChangeUser.cs:
--------------------------------------------------------------------------------
1 | namespace Graph.Community
2 | {
3 | public class ChangeUser : Change
4 | {
5 | public bool Activate { get; set; }
6 | public int UserId { get; set; }
7 |
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/src/Models/ChangeLog/ChangeWeb.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Graph.Community
4 | {
5 | public class ChangeWeb : Change
6 | {
7 | public Guid WebId { get; set; }
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/src/Models/Form.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Microsoft.Graph;
3 |
4 | namespace Graph.Community
5 | {
6 | public class Form : BaseItem
7 | {
8 | public PageType FormType { get; set; }
9 |
10 | public new Guid Id { get; set; }
11 |
12 | public string ServerRelativeUrl { get; set; }
13 | }
14 |
15 | public enum PageType
16 | {
17 | Invalid = -1,
18 | DefaultView = 0,
19 | NormalView = 1,
20 | DialogView = 2,
21 | View = 3,
22 | DisplayForm = 4,
23 | DisplayFormDialog = 5,
24 | EditForm = 6,
25 | EditFormDialog = 7,
26 | NewForm = 8,
27 | NewFormDialog = 9,
28 | SolutionForm = 10,
29 | PAGE_MAXITEMS = 11
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/src/Models/Group.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using System.Text.Json.Serialization;
3 |
4 | namespace Graph.Community
5 | {
6 | [SPDerivedTypeConverter(typeof(SPODataTypeConverter))]
7 | public class Group : Principal
8 | {
9 | [JsonPropertyName("AllowMembersEditMembership")]
10 | public bool AllowMembersEditMembership { get; set; }
11 |
12 | [JsonPropertyName("AllowRequestToJoinLeave")]
13 | public bool AllowRequestToJoinLeave { get; set; }
14 |
15 | [JsonPropertyName("AutoAcceptRequestToJoinLeave")]
16 | public bool AutoAcceptRequestToJoinLeave { get; set; }
17 |
18 | [JsonPropertyName("Description")]
19 | public new string Description { get; set; }
20 |
21 | [JsonPropertyName("OnlyAllowMembersViewMembership")]
22 | public bool OnlyAllowMembersViewMembership { get; set; }
23 |
24 | [JsonPropertyName("Owner@odata.navigationLink")]
25 | public string OwnerNavigationLink { get; set; }
26 |
27 | [JsonPropertyName("Owner")]
28 | public Principal Owner { get; set; }
29 |
30 | [JsonPropertyName("OwnerTitle")]
31 | public string OwnerTitle { get; set; }
32 |
33 | [JsonPropertyName("RequestToJoinLeaveEmailSetting")]
34 | public string RequestToJoinLeaveEmailSetting { get; set; }
35 |
36 | [JsonPropertyName("Users@odata.navigationLink")]
37 | public string UsersNavigationLink { get; set; }
38 |
39 | [JsonPropertyName("Users")]
40 | public List Users { get; private set; }
41 |
42 | public Group()
43 | {
44 | this.Users = new List();
45 | }
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/src/Models/HttpMessages/ApplySiteDesignRequest.cs:
--------------------------------------------------------------------------------
1 | namespace Graph.Community
2 | {
3 | public class ApplySiteDesignRequest
4 | {
5 | ///
6 | /// Id of the site design to apply
7 | ///
8 | public string SiteDesignId { get; set; }
9 |
10 | ///
11 | /// Absolute URL of site (site collection root) to which design is applied
12 | ///
13 | public string WebUrl { get; set; }
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/src/Models/HttpMessages/ApplySiteDesignResponse.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using System.Diagnostics;
3 | using System.Text.Json.Serialization;
4 |
5 | namespace Graph.Community
6 | {
7 | public class ApplySiteDesignResponse
8 | {
9 | [JsonPropertyName("value")]
10 | public List ActionOutcomes { get; }
11 |
12 | public ApplySiteDesignResponse()
13 | {
14 | this.ActionOutcomes = new List();
15 | }
16 | }
17 |
18 | [DebuggerDisplay("{Title, nq}")]
19 | public class SiteScriptActionResult
20 | {
21 | [JsonPropertyName("Outcome")]
22 | [JsonConverter(typeof(SPEnumIntAsStringConverter))]
23 | public SiteScriptActionOutcome Outcome { get; set; }
24 |
25 | [JsonPropertyName("OutcomeText")]
26 | public string OutcomeText { get; set; }
27 |
28 | [JsonPropertyName("Title")]
29 | public string Title { get; set; }
30 |
31 | public SiteScriptActionResult()
32 | {
33 | }
34 | }
35 |
36 | public enum SiteScriptActionOutcome
37 | {
38 | Success,
39 | Failure,
40 | NoOp,
41 | SucceededWithException
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/src/Models/HttpMessages/CreateSiteDesignRequest.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text.Json.Serialization;
4 |
5 | namespace Graph.Community
6 | {
7 | public class CreateSiteDesignRequest
8 | {
9 | public Info info { get; set; }
10 |
11 | public CreateSiteDesignRequest(SiteDesignMetadata siteDesignMetadata)
12 | {
13 | if (siteDesignMetadata == null)
14 | {
15 | throw new ArgumentNullException(nameof(siteDesignMetadata));
16 | }
17 |
18 | info = new Info
19 | {
20 | Title = siteDesignMetadata.Title,
21 | Description = siteDesignMetadata.Description,
22 | SiteScriptIds = siteDesignMetadata.SiteScriptIds,
23 | WebTemplate = siteDesignMetadata.WebTemplate,
24 | PreviewImageUrl = siteDesignMetadata.PreviewImageUrl,
25 | PreviewImageAltText = siteDesignMetadata.PreviewImageAltText,
26 | ThumbnailUrl = siteDesignMetadata.ThumbnailUrl,
27 | };
28 |
29 | }
30 |
31 | public class Info
32 | {
33 | [JsonPropertyName("Title")]
34 | public string Title { get; set; }
35 |
36 | [JsonPropertyName("Description")]
37 | public string Description { get; set; }
38 |
39 | [JsonPropertyName("SiteScriptIds")]
40 | public List SiteScriptIds { get; set; }
41 |
42 | [JsonPropertyName("WebTemplate")]
43 | public string WebTemplate { get; set; }
44 |
45 | [JsonPropertyName("PreviewImageUrl")]
46 | public string PreviewImageUrl { get; set; }
47 |
48 | [JsonPropertyName("PreviewImageAltText")]
49 | public string PreviewImageAltText { get; set; }
50 |
51 | [JsonPropertyName("ThumbnailUrl")]
52 | public string ThumbnailUrl { get; set; }
53 | }
54 |
55 | }
56 | }
57 |
--------------------------------------------------------------------------------
/src/Models/HttpMessages/GetChangesRequest.cs:
--------------------------------------------------------------------------------
1 | namespace Graph.Community
2 | {
3 | public class GetChangesRequest
4 | {
5 | public ChangeQuery Query { get; set; }
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/src/Models/HttpMessages/SiteDesignRequestInfo.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text.Json.Serialization;
4 |
5 | namespace Graph.Community
6 | {
7 | public class SiteDesignRequestInfo
8 | {
9 | [JsonPropertyName("Title")]
10 | public string Title { get; set; }
11 |
12 | [JsonPropertyName("Description")]
13 | public string Description { get; set; }
14 |
15 | [JsonPropertyName("SiteScriptIds")]
16 | public List SiteScriptIds { get; set; }
17 |
18 | [JsonPropertyName("WebTemplate")]
19 | public string WebTemplate { get; set; }
20 |
21 | [JsonPropertyName("PreviewImageUrl")]
22 | public string PreviewImageUrl { get; set; }
23 |
24 | [JsonPropertyName("PreviewImageAltText")]
25 | public string PreviewImageAltText { get; set; }
26 |
27 | [JsonPropertyName("ThumbnailUrl")]
28 | public string ThumbnailUrl { get; set; }
29 |
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/src/Models/HttpMessages/SiteScriptRequestInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Text.Json.Serialization;
2 |
3 | namespace Graph.Community
4 | {
5 | public class SiteScriptRequestInfo
6 | {
7 | [JsonPropertyName("Title")]
8 | public string Title { get; set; }
9 |
10 | [JsonPropertyName("Description")]
11 | public string Description { get; set; }
12 |
13 | [JsonPropertyName("Version")]
14 | public int? Version { get; set; }
15 |
16 | [JsonPropertyName("Content")]
17 | public string Content { get; set; }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/src/Models/HttpMessages/StorageEntitiesResponse.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 | using System.Text.Json.Serialization;
5 |
6 | namespace Graph.Community
7 | {
8 | public class StorageEntitiesResponse
9 | {
10 | [JsonPropertyName("storageentitiesindex")]
11 | public string StorageEntitiesIndex { get; set; }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/src/Models/HttpMessages/TenantSettingsResponse.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 | using System.Text.Json.Serialization;
5 |
6 | namespace Graph.Community
7 | {
8 | public class TenantSettingsResponse
9 | {
10 | [JsonPropertyName("CorporateCatalogUrl")]
11 | public string CorporateCatalogUrl { get; set; }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/src/Models/HttpMessages/UpdateSiteDesignRequest.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Text.Json.Serialization;
3 |
4 | namespace Graph.Community
5 | {
6 | public class UpdateSiteDesignRequest
7 | {
8 | public Info updateInfo { get; set; }
9 |
10 | public UpdateSiteDesignRequest(string siteDesignId, SiteDesignMetadata siteDesignMetadata)
11 | {
12 | if (siteDesignId is null)
13 | {
14 | throw new ArgumentNullException(nameof(siteDesignId));
15 | }
16 |
17 | if (siteDesignMetadata == null)
18 | {
19 | throw new ArgumentNullException(nameof(siteDesignMetadata));
20 | }
21 |
22 | updateInfo = new Info
23 | {
24 | Id = siteDesignId,
25 | Title = siteDesignMetadata.Title,
26 | Description = siteDesignMetadata.Description,
27 | SiteScriptIds = siteDesignMetadata.SiteScriptIds,
28 | WebTemplate = siteDesignMetadata.WebTemplate,
29 | PreviewImageUrl = siteDesignMetadata.PreviewImageUrl,
30 | PreviewImageAltText = siteDesignMetadata.PreviewImageAltText,
31 | ThumbnailUrl = siteDesignMetadata.ThumbnailUrl
32 | };
33 | }
34 |
35 |
36 | public class Info : SiteDesignRequestInfo
37 | {
38 | [JsonPropertyName("Id")]
39 | public string Id { get; set; }
40 | }
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/src/Models/HttpMessages/UpdateSiteScriptRequest.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Text.Json.Serialization;
3 |
4 | namespace Graph.Community
5 | {
6 | public class UpdateSiteScriptRequest
7 | {
8 | public Info updateInfo { get; set; }
9 |
10 | public UpdateSiteScriptRequest(string siteScriptId, SiteScriptMetadata siteScriptMetadata)
11 | {
12 | if (siteScriptId is null)
13 | {
14 | throw new ArgumentNullException(nameof(siteScriptId));
15 | }
16 |
17 | if (siteScriptMetadata == null)
18 | {
19 | throw new ArgumentNullException(nameof(siteScriptMetadata));
20 | }
21 |
22 | updateInfo = new Info
23 | {
24 | Id = siteScriptId,
25 | Title = siteScriptMetadata.Title,
26 | Description = siteScriptMetadata.Description,
27 | Version = siteScriptMetadata.Version,
28 | Content = siteScriptMetadata.Content
29 | };
30 | }
31 |
32 |
33 | public class Info : SiteScriptRequestInfo
34 | {
35 | [JsonPropertyName("Id")]
36 | public string Id { get; set; }
37 | }
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/src/Models/List.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Graph;
2 |
3 | namespace Graph.Community
4 | {
5 | public class List : BaseItem
6 | {
7 | public new string Id { get; set; }
8 | public string Title { get; set; }
9 | public int BaseTemplate { get; set; }
10 | public System.Collections.Generic.List