Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added market hours and indices #110

Merged
merged 3 commits into from
Jul 17, 2023
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package io.polygon.kotlin.sdk.rest.reference

import io.ktor.http.*
import io.polygon.kotlin.sdk.rest.PolygonRestOption
import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable

/** See [PolygonReferenceClient.getMarketStatusBlocking] */
Expand All @@ -15,7 +16,10 @@ suspend fun PolygonReferenceClient.getMarketStatus(vararg opts: PolygonRestOptio
data class MarketStatusDTO(
val market: String? = null,
val serverTime: String? = null,
val afterHours: Boolean = false,
val earlyHours: Boolean = false,
val exchanges: ExchangesStatusDTO = ExchangesStatusDTO(),
val indicesGroups: IndicesGroupsStatusDTO = IndicesGroupsStatusDTO(),
val currencies: CurrenciesStatusDTO = CurrenciesStatusDTO()
)

Expand All @@ -26,8 +30,21 @@ data class ExchangesStatusDTO(
val otc: String? = null
)

@Serializable
data class IndicesGroupsStatusDTO(
@SerialName("s_and_p") val sAndP: String? = null,
@SerialName("societe_generale") val societeGenerale: String? = null,
@SerialName("msci") val msci: String? = null,
@SerialName("ftse_russell") val ftseRussell: String? = null,
@SerialName("mstar") val mstar: String? = null,
@SerialName("mstarc") val mstarc: String? = null,
@SerialName("cccy") val cccy: String? = null,
@SerialName("nasdaq") val nasdaq: String? = null,
@SerialName("dow_jones") val dowJones: String? = null
)

@Serializable
data class CurrenciesStatusDTO(
val fx: String? = null,
val crypto: String? = null
)
)