Interface IHonuaPortalClient
- Namespace
- Honua.Sdk.GeoServices.Portal
- Assembly
- Honua.Sdk.GeoServices.dll
Typed client interface for a Honua /sharing/rest Portal facade.
public interface IHonuaPortalClient
Properties
Address
Normalized Honua root and /sharing/rest addresses for this client.
PortalAddress Address { get; }
Property Value
CurrentCredential
Most recent credential returned by GenerateTokenAsync(PortalGenerateTokenRequest, CancellationToken), or null.
PortalTokenCredential? CurrentCredential { get; }
Property Value
CurrentToken
Currently held Portal token, or null when unauthenticated.
string? CurrentToken { get; }
Property Value
Methods
GenerateTokenAsync(PortalGenerateTokenRequest, CancellationToken)
Exchanges username and password at POST /sharing/rest/generateToken, stores the issued token, and returns the credential with Expires in Unix milliseconds.
Task<PortalTokenCredential> GenerateTokenAsync(PortalGenerateTokenRequest request, CancellationToken cancellationToken = default)
Parameters
requestPortalGenerateTokenRequestcancellationTokenCancellationToken
Returns
GetInfoAsync(CancellationToken)
Fetches Portal discovery and authentication metadata from GET /sharing/rest/info.
Task<PortalInfo> GetInfoAsync(CancellationToken cancellationToken = default)
Parameters
cancellationTokenCancellationToken
Returns
GetItemAsync(string, string?, CancellationToken)
Fetches a single sharing entry by identifier from GET /sharing/rest/content/items/{id}.
Task<PortalSharingItem> GetItemAsync(string itemId, string? token = null, CancellationToken cancellationToken = default)
Parameters
itemIdstringtokenstringcancellationTokenCancellationToken
Returns
GetItemDataAsync(string, string?, CancellationToken)
Fetches the raw JSON data document from GET /sharing/rest/content/items/{id}/data; the caller owns and must dispose the returned document.
Task<JsonDocument> GetItemDataAsync(string itemId, string? token = null, CancellationToken cancellationToken = default)
Parameters
itemIdstringtokenstringcancellationTokenCancellationToken
Returns
GetPortalSelfAsync(string?, CancellationToken)
Fetches Portal identity and caller details from GET /sharing/rest/portals/self.
Task<PortalSelf> GetPortalSelfAsync(string? token = null, CancellationToken cancellationToken = default)
Parameters
tokenstringcancellationTokenCancellationToken
Returns
OpenFeatureService(PortalSharingItem, PortalFeatureServiceOpenOptions?)
Opens a resolved Feature Service entry as an authenticated PortalFeatureServiceHandle carrying the Portal token.
PortalFeatureServiceHandle OpenFeatureService(PortalSharingItem item, PortalFeatureServiceOpenOptions? options = null)
Parameters
itemPortalSharingItemoptionsPortalFeatureServiceOpenOptions
Returns
OpenFeatureServiceAsync(string, PortalFeatureServiceOpenOptions?, CancellationToken)
Fetches an entry by identifier and opens its Feature Service URL as an authenticated PortalFeatureServiceHandle carrying the Portal token.
Task<PortalFeatureServiceHandle> OpenFeatureServiceAsync(string itemId, PortalFeatureServiceOpenOptions? options = null, CancellationToken cancellationToken = default)
Parameters
itemIdstringoptionsPortalFeatureServiceOpenOptionscancellationTokenCancellationToken
Returns
ResolveFeatureService(PortalSharingItem)
Parses a Feature Service entry URL into its normalized GeoServices FeatureServer target.
PortalFeatureServiceResolution ResolveFeatureService(PortalSharingItem item)
Parameters
itemPortalSharingItem
Returns
SearchAsync(PortalSearchRequest?, CancellationToken)
Fetches a single page of sharing entries from GET /sharing/rest/search.
Task<PortalSearchResponse> SearchAsync(PortalSearchRequest? request = null, CancellationToken cancellationToken = default)
Parameters
requestPortalSearchRequestcancellationTokenCancellationToken
Returns
SearchPagesAsync(PortalSearchRequest?, CancellationToken)
Iterates paged GET /sharing/rest/search responses until the server signals nextStart = -1.
IAsyncEnumerable<PortalSearchResponse> SearchPagesAsync(PortalSearchRequest? request = null, CancellationToken cancellationToken = default)
Parameters
requestPortalSearchRequestcancellationTokenCancellationToken
Returns
SetToken(string?)
Sets or clears the Portal token attached to subsequent authenticated requests.
void SetToken(string? token)
Parameters
tokenstring