-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0113290
commit 4f89aba
Showing
15 changed files
with
332 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
using System.Collections.Generic; | ||
using System.Threading; | ||
using System.Threading.Tasks; | ||
using Microsoft.Graph; | ||
|
||
namespace Graph.Community | ||
{ | ||
public class HubRequest:BaseSharePointAPIRequest, IHubRequest | ||
{ | ||
public HubRequest( | ||
string requestUrl, | ||
IBaseClient client, | ||
IEnumerable<Option> options) | ||
: base("Hub", requestUrl, client, options) | ||
{ | ||
this.Headers.Add(new HeaderOption(SharePointAPIRequestConstants.Headers.AcceptHeaderName, SharePointAPIRequestConstants.Headers.AcceptHeaderValue)); | ||
this.Headers.Add(new HeaderOption(SharePointAPIRequestConstants.Headers.ODataVersionHeaderName, SharePointAPIRequestConstants.Headers.ODataVersionHeaderValue)); | ||
} | ||
|
||
public Task<Hub> GetAsync() | ||
{ | ||
return this.GetAsync(CancellationToken.None); | ||
} | ||
|
||
public async Task<Hub> GetAsync(CancellationToken cancellationToken) | ||
{ | ||
this.ContentType = "application/json"; | ||
var entity = await this.SendAsync<Hub>(null, cancellationToken).ConfigureAwait(false); | ||
return entity; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
using System.Collections.Generic; | ||
using Microsoft.Graph; | ||
|
||
namespace Graph.Community | ||
{ | ||
public class HubRequestBuilder : BaseRequestBuilder,IHubRequestBuilder | ||
{ | ||
private readonly IEnumerable<Option> options; | ||
|
||
public HubRequestBuilder( | ||
string requestUrl, | ||
IBaseClient client, | ||
IEnumerable<Option> options = null) | ||
: base(requestUrl, client) | ||
{ | ||
this.options = options; | ||
} | ||
|
||
/// <summary> | ||
/// Builds the request. | ||
/// </summary> | ||
/// <returns>The built request.</returns> | ||
public IHubRequest Request() | ||
{ | ||
return this.Request(this.options); | ||
} | ||
|
||
/// <summary> | ||
/// Builds the request. | ||
/// </summary> | ||
/// <param name="options">The query and header options for the request.</param> | ||
/// <returns>The built request.</returns> | ||
public IHubRequest Request(IEnumerable<Option> options) | ||
{ | ||
return new HubRequest(this.RequestUrl, this.Client, options); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
using System.Threading.Tasks; | ||
using System.Threading; | ||
using Microsoft.Graph; | ||
|
||
namespace Graph.Community | ||
{ | ||
public interface IHubRequest : IBaseRequest | ||
{ | ||
Task<Hub> GetAsync(); | ||
Task<Hub> GetAsync(CancellationToken cancellationToken); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
using System.Collections.Generic; | ||
using Microsoft.Graph; | ||
|
||
namespace Graph.Community | ||
{ | ||
public interface IHubRequestBuilder : IBaseRequestBuilder | ||
{ | ||
/// <summary> | ||
/// Builds the request. | ||
/// </summary> | ||
/// <returns>The built request.</returns> | ||
IHubRequest Request(); | ||
|
||
/// <summary> | ||
/// Builds the request. | ||
/// </summary> | ||
/// <param name="options">The query and header options for the request.</param> | ||
/// <returns>The built request.</returns> | ||
IHubRequest Request(IEnumerable<Option> options); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.