Show / Hide Table of Contents

Interface IApodClient

An interface for a client that interfaces with NASA's Astronomy Picture of the Day API.

Namespace: Apod
Assembly: Apod.dll
Syntax
public interface IApodClient
Remarks

See ApodClient for the default implementation.

NASA's Astronomy Picture of the Day API can be found at https://api.nasa.gov#apod.

Methods

| Improve this Doc View Source

FetchApodAsync()

Fetch the Astronomy Picture of the Day for today's date.

Declaration
ValueTask<ApodResponse> FetchApodAsync()
Returns
Type Description
ValueTask<ApodResponse>

The response.

| Improve this Doc View Source

FetchApodAsync(DateTime)

Fetch the Astronomy Picture of the Day for a specific date.

Declaration
ValueTask<ApodResponse> FetchApodAsync(DateTime dateTime)
Parameters
Type Name Description
DateTime dateTime

The date to request the APOD for. Must be between June 16th 1995 and today's date (inclusive).

Returns
Type Description
ValueTask<ApodResponse>

The response.

| Improve this Doc View Source

FetchApodAsync(DateTime, DateTime)

Fetch all the Astronomy Pictures of the Day between two dates (inclusive).

Declaration
ValueTask<ApodResponse> FetchApodAsync(DateTime startDate, DateTime endDate)
Parameters
Type Name Description
DateTime startDate

The start date. Must be between June 16th 1995 and today's date (inclusive).

DateTime endDate

The end date. Must be between the startDate and today's date (inclusive). Defaults to today's date.

Returns
Type Description
ValueTask<ApodResponse>

The response.

| Improve this Doc View Source

FetchApodAsync(Int32)

Fetch an amount of random Astronomy Pictures of the Day.

Declaration
ValueTask<ApodResponse> FetchApodAsync(int count)
Parameters
Type Name Description
Int32 count

The amount of APODs to fetch. Must be positive and cannot exceed 100.

Returns
Type Description
ValueTask<ApodResponse>

The response.

| Improve this Doc View Source

GetPermalink(ApodContent)

Get the apod.nasa.gov permalink for an Astronomy Picture of the Day. Example format: https://apod.nasa.gov/apod/apYYMMDD.html.

Declaration
string GetPermalink(ApodContent apodContent)
Parameters
Type Name Description
ApodContent apodContent

The Astronomy Picture of the Day to get the permalink for.

Returns
Type Description
String

The permalink URL to this APOD.

See Also

ApodClient
  • Improve this Doc
  • View Source
Back to top Generated by DocFX