Table of Contents

Class RustMapsClient

Namespace
RustMapsApi.V4
Assembly
RustMapsApi.dll

A strongly-typed client for the RustMaps API v4.

public sealed class RustMapsClient : IRustMapsClient
Inheritance
RustMapsClient
Implements
Inherited Members

Constructors

RustMapsClient(HttpClient)

A strongly-typed client for the RustMaps API v4.

public RustMapsClient(HttpClient httpClient)

Parameters

httpClient HttpClient

The configured HTTP client (base address and auth header set by the caller).

Methods

CreateCustomMapAsync(CreateCustomMapRequest, CancellationToken)

Requests generation of a custom map from explicit settings.

public Task<Result<MapGenerationStatus>> CreateCustomMapAsync(CreateCustomMapRequest request, CancellationToken cancellationToken = default)

Parameters

request CreateCustomMapRequest

The custom-map request.

cancellationToken CancellationToken

A token to cancel the request.

Returns

Task<Result<MapGenerationStatus>>

The generation status.

CreateCustomMapFromConfigAsync(CreateCustomMapFromConfigRequest, CancellationToken)

Requests generation of a custom map from a saved config.

public Task<Result<MapGenerationStatus>> CreateCustomMapFromConfigAsync(CreateCustomMapFromConfigRequest request, CancellationToken cancellationToken = default)

Parameters

request CreateCustomMapFromConfigRequest

The custom-map-from-config request.

cancellationToken CancellationToken

A token to cancel the request.

Returns

Task<Result<MapGenerationStatus>>

The generation status.

CreateMapAsync(MapGenerationRequest, CancellationToken)

Requests generation of a standard map.

public Task<Result<MapGenerationStatus>> CreateMapAsync(MapGenerationRequest request, CancellationToken cancellationToken = default)

Parameters

request MapGenerationRequest

The generation parameters.

cancellationToken CancellationToken

A token to cancel the request.

Returns

Task<Result<MapGenerationStatus>>

The generation status.

GetDefaultCustomConfigAsync(CancellationToken)

Gets the default custom-map configuration.

public Task<Result<CustomMapSettings>> GetDefaultCustomConfigAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

A token to cancel the request.

Returns

Task<Result<CustomMapSettings>>

The default settings.

GetLimitsAsync(string?, CancellationToken)

Gets the current map-generation limits.

public Task<Result<MapGenLimits>> GetLimitsAsync(string? orgId = null, CancellationToken cancellationToken = default)

Parameters

orgId string

The organisation to scope to, if any.

cancellationToken CancellationToken

A token to cancel the request.

Returns

Task<Result<MapGenLimits>>

The generation limits.

GetMapByIdAsync(string, CancellationToken)

Gets a map by its identifier.

public Task<Result<MapInfo>> GetMapByIdAsync(string mapId, CancellationToken cancellationToken = default)

Parameters

mapId string

The map identifier.

cancellationToken CancellationToken

A token to cancel the request.

Returns

Task<Result<MapInfo>>

The map information.

GetMapBySeedAndSizeAsync(int, int, bool, CancellationToken)

Gets a procedural map by its size and seed.

public Task<Result<MapInfo>> GetMapBySeedAndSizeAsync(int size, int seed, bool staging, CancellationToken cancellationToken = default)

Parameters

size int

The map size.

seed int

The map seed.

staging bool

Whether to query the staging branch.

cancellationToken CancellationToken

A token to cancel the request.

Returns

Task<Result<MapInfo>>

The map information.

GetMapByUrlAsync(string, CancellationToken)

Gets a map by its RustMaps URL.

public Task<Result<MapInfo>> GetMapByUrlAsync(string url, CancellationToken cancellationToken = default)

Parameters

url string

The RustMaps map URL.

cancellationToken CancellationToken

A token to cancel the request.

Returns

Task<Result<MapInfo>>

The map information.

GetMapSettingsAsync(string, CancellationToken)

Gets the custom-map settings used to generate a map.

public Task<Result<CustomMapSettings>> GetMapSettingsAsync(string mapId, CancellationToken cancellationToken = default)

Parameters

mapId string

The map identifier.

cancellationToken CancellationToken

A token to cancel the request.

Returns

Task<Result<CustomMapSettings>>

The settings tree.

GetSavedConfigsAsync(CancellationToken)

Gets the caller's saved custom-map configs.

public Task<Result<IReadOnlyList<MapSettings>>> GetSavedConfigsAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

A token to cancel the request.

Returns

Task<Result<IReadOnlyList<MapSettings>>>

The saved, named configs.

SearchAsync(SearchQuery, int, SearchOptions?, string?, CancellationToken)

Searches maps using a structured query.

public Task<Result<IReadOnlyList<MapThumbnail>>> SearchAsync(SearchQuery query, int page, SearchOptions? options = null, string? orgId = null, CancellationToken cancellationToken = default)

Parameters

query SearchQuery

The search query.

page int

The zero-based page index.

options SearchOptions

Optional query parameters.

orgId string

The organisation to scope to, if any.

cancellationToken CancellationToken

A token to cancel the request.

Returns

Task<Result<IReadOnlyList<MapThumbnail>>>

The matching map thumbnails.

SearchByFilterAsync(string, int, SearchOptions?, string?, CancellationToken)

Searches maps using a saved filter.

public Task<Result<IReadOnlyList<MapThumbnail>>> SearchByFilterAsync(string filterId, int page, SearchOptions? options = null, string? orgId = null, CancellationToken cancellationToken = default)

Parameters

filterId string

The saved filter identifier.

page int

The zero-based page index.

options SearchOptions

Optional query parameters.

orgId string

The organisation to scope to, if any.

cancellationToken CancellationToken

A token to cancel the request.

Returns

Task<Result<IReadOnlyList<MapThumbnail>>>

The matching map thumbnails.

UploadMapAsync(MapUpload, CancellationToken)

Uploads a pre-generated map save file.

[SuppressMessage("Reliability", "CA2000:Dispose objects before losing scope", Justification = "Child HttpContent instances are owned and disposed by the enclosing MultipartFormDataContent.")]
public Task<Result<UploadedMap>> UploadMapAsync(MapUpload upload, CancellationToken cancellationToken = default)

Parameters

upload MapUpload

The upload payload.

cancellationToken CancellationToken

A token to cancel the request.

Returns

Task<Result<UploadedMap>>

The uploaded map.