Files
octokit.net/Octokit.Reactive/Clients/ObservableMetaClient.cs
Colby Williams f9fb116eab [FEAT]: Add support for Public Keys API (#2945)
* Add support for /mets/public_keys/<keyType>

* "files.insertFinalNewline": false

* revert and make setttings.json change csharp only

* formatting

* remove final new line

---------

Co-authored-by: Nick Floyd <139819+nickfloyd@users.noreply.github.com>
2024-12-27 14:05:00 -06:00

42 lines
1.3 KiB
C#

using System;
using System.Reactive.Linq;
using System.Reactive.Threading.Tasks;
namespace Octokit.Reactive
{
/// <summary>
/// A client for GitHub's meta APIs.
/// </summary>
/// <remarks>
/// See the <a href="https://docs.github.com/rest/meta">Meta API documentation</a> for more details.
/// </remarks>
public class ObservableMetaClient : IObservableMetaClient
{
private readonly IMetaClient _client;
public ObservableMetaClient(IGitHubClient client)
{
Ensure.ArgumentNotNull(client, nameof(client));
PublicKeys = new ObservablePublicKeysClient(client);
_client = client.Meta;
}
/// <summary>
/// Returns a client to manage get public keys for validating request signatures.
/// </summary>
public IObservablePublicKeysClient PublicKeys { get; private set; }
/// <summary>
/// Retrieves information about GitHub.com, the service or a GitHub Enterprise installation.
/// </summary>
/// <exception cref="ApiException">Thrown when a general API error occurs.</exception>
/// <returns>An <see cref="Meta"/> containing metadata about the GitHub instance.</returns>
public IObservable<Meta> GetMetadata()
{
return _client.GetMetadata().ToObservable();
}
}
}