From 9841cd0c13c7bfa5e31ae7208f0ee4df38a8e67f Mon Sep 17 00:00:00 2001 From: Alexey Illarionov Date: Wed, 15 Jan 2025 14:08:49 +0300 Subject: [PATCH] Add GameTimeToBeat (#160) --- .../api/android/igdbclient-core.api | 82 +++++++++++++++++++ igdbclient-core/api/jvm/igdbclient-core.api | 82 +++++++++++++++++++ .../src/commonMain/kotlin/IgdbClient.kt | 7 ++ .../src/commonMain/kotlin/IgdbEndpoint.kt | 11 +++ .../apicalypse/ApicalypseQueryBuilder.kt | 2 +- .../src/commonMain/proto/igdbapi.proto | 18 +++- .../kotlin/RealKtorNetworkTestClient.kt | 10 +++ 7 files changed, 210 insertions(+), 2 deletions(-) diff --git a/igdbclient-core/api/android/igdbclient-core.api b/igdbclient-core/api/android/igdbclient-core.api index 5929e6a..ff8cc86 100644 --- a/igdbclient-core/api/android/igdbclient-core.api +++ b/igdbclient-core/api/android/igdbclient-core.api @@ -32,6 +32,7 @@ public final class ru/pixnews/igdbclient/IgdbClientKt { public static final fun getGameEngines (Lru/pixnews/igdbclient/IgdbClient;Lkotlin/jvm/functions/Function1;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public static final fun getGameLocalizations (Lru/pixnews/igdbclient/IgdbClient;Lkotlin/jvm/functions/Function1;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public static final fun getGameModes (Lru/pixnews/igdbclient/IgdbClient;Lkotlin/jvm/functions/Function1;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static final fun getGameTimeToBeat (Lru/pixnews/igdbclient/IgdbClient;Lkotlin/jvm/functions/Function1;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public static final fun getGameVersionFeatureValues (Lru/pixnews/igdbclient/IgdbClient;Lkotlin/jvm/functions/Function1;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public static final fun getGameVersionFeatures (Lru/pixnews/igdbclient/IgdbClient;Lkotlin/jvm/functions/Function1;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public static final fun getGameVersions (Lru/pixnews/igdbclient/IgdbClient;Lkotlin/jvm/functions/Function1;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; @@ -115,6 +116,7 @@ public final class ru/pixnews/igdbclient/IgdbEndpoint$Companion { public final fun getGAME_ENGINE_LOGO ()Lru/pixnews/igdbclient/IgdbEndpoint; public final fun getGAME_LOCALIZATION ()Lru/pixnews/igdbclient/IgdbEndpoint; public final fun getGAME_MODE ()Lru/pixnews/igdbclient/IgdbEndpoint; + public final fun getGAME_TIME_TO_BEAT ()Lru/pixnews/igdbclient/IgdbEndpoint; public final fun getGAME_VERSION ()Lru/pixnews/igdbclient/IgdbEndpoint; public final fun getGAME_VERSION_FEATURE ()Lru/pixnews/igdbclient/IgdbEndpoint; public final fun getGAME_VERSION_FEATURE_VALUE ()Lru/pixnews/igdbclient/IgdbEndpoint; @@ -859,6 +861,23 @@ public final class ru/pixnews/igdbclient/dsl/field/GameModeFieldDslKt { public static final fun getField (Lru/pixnews/igdbclient/model/GameMode$Companion;)Lru/pixnews/igdbclient/dsl/field/GameModeFieldDsl; } +public final class ru/pixnews/igdbclient/dsl/field/GameTimeToBeatFieldDsl : ru/pixnews/igdbclient/dsl/field/IgdbRequestFieldDsl { + public fun ()V + public final fun getChecksum ()Lru/pixnews/igdbclient/dsl/field/IgdbRequestField; + public final fun getCompletely ()Lru/pixnews/igdbclient/dsl/field/IgdbRequestField; + public final fun getCount ()Lru/pixnews/igdbclient/dsl/field/IgdbRequestField; + public final fun getCreated_at ()Lru/pixnews/igdbclient/dsl/field/IgdbRequestField; + public final fun getGame_id ()Lru/pixnews/igdbclient/dsl/field/IgdbRequestField; + public final fun getHastily ()Lru/pixnews/igdbclient/dsl/field/IgdbRequestField; + public final fun getId ()Lru/pixnews/igdbclient/dsl/field/IgdbRequestField; + public final fun getNormally ()Lru/pixnews/igdbclient/dsl/field/IgdbRequestField; + public final fun getUpdated_at ()Lru/pixnews/igdbclient/dsl/field/IgdbRequestField; +} + +public final class ru/pixnews/igdbclient/dsl/field/GameTimeToBeatFieldDslKt { + public static final fun getField (Lru/pixnews/igdbclient/model/GameTimeToBeat$Companion;)Lru/pixnews/igdbclient/dsl/field/GameTimeToBeatFieldDsl; +} + public final class ru/pixnews/igdbclient/dsl/field/GameVersionFeatureFieldDsl : ru/pixnews/igdbclient/dsl/field/IgdbRequestFieldDsl { public fun ()V public final fun getCategory ()Lru/pixnews/igdbclient/dsl/field/IgdbRequestField; @@ -3029,6 +3048,52 @@ public final class ru/pixnews/igdbclient/model/GameStatusEnum$Companion { public final fun fromValue (I)Lru/pixnews/igdbclient/model/GameStatusEnum; } +public final class ru/pixnews/igdbclient/model/GameTimeToBeat : com/squareup/wire/Message { + public static final field ADAPTER Lcom/squareup/wire/ProtoAdapter; + public static final field Companion Lru/pixnews/igdbclient/model/GameTimeToBeat$Companion; + public fun ()V + public fun (JIIIIILjava/time/Instant;Ljava/time/Instant;Ljava/lang/String;Lokio/ByteString;)V + public synthetic fun (JIIIIILjava/time/Instant;Ljava/time/Instant;Ljava/lang/String;Lokio/ByteString;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public final fun copy (JIIIIILjava/time/Instant;Ljava/time/Instant;Ljava/lang/String;Lokio/ByteString;)Lru/pixnews/igdbclient/model/GameTimeToBeat; + public static synthetic fun copy$default (Lru/pixnews/igdbclient/model/GameTimeToBeat;JIIIIILjava/time/Instant;Ljava/time/Instant;Ljava/lang/String;Lokio/ByteString;ILjava/lang/Object;)Lru/pixnews/igdbclient/model/GameTimeToBeat; + public fun equals (Ljava/lang/Object;)Z + public final fun getChecksum ()Ljava/lang/String; + public final fun getCompletely ()I + public final fun getCount ()I + public final fun getCreated_at ()Ljava/time/Instant; + public final fun getGame_id ()I + public final fun getHastily ()I + public final fun getId ()J + public final fun getNormally ()I + public final fun getUpdated_at ()Ljava/time/Instant; + public fun hashCode ()I + public synthetic fun newBuilder ()Lcom/squareup/wire/Message$Builder; + public synthetic fun newBuilder ()Ljava/lang/Void; + public fun toString ()Ljava/lang/String; +} + +public final class ru/pixnews/igdbclient/model/GameTimeToBeat$Companion { +} + +public final class ru/pixnews/igdbclient/model/GameTimeToBeatResult : com/squareup/wire/Message { + public static final field ADAPTER Lcom/squareup/wire/ProtoAdapter; + public static final field Companion Lru/pixnews/igdbclient/model/GameTimeToBeatResult$Companion; + public fun ()V + public fun (Ljava/util/List;Lokio/ByteString;)V + public synthetic fun (Ljava/util/List;Lokio/ByteString;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public final fun copy (Ljava/util/List;Lokio/ByteString;)Lru/pixnews/igdbclient/model/GameTimeToBeatResult; + public static synthetic fun copy$default (Lru/pixnews/igdbclient/model/GameTimeToBeatResult;Ljava/util/List;Lokio/ByteString;ILjava/lang/Object;)Lru/pixnews/igdbclient/model/GameTimeToBeatResult; + public fun equals (Ljava/lang/Object;)Z + public final fun getGametimetobeats ()Ljava/util/List; + public fun hashCode ()I + public synthetic fun newBuilder ()Lcom/squareup/wire/Message$Builder; + public synthetic fun newBuilder ()Ljava/lang/Void; + public fun toString ()Ljava/lang/String; +} + +public final class ru/pixnews/igdbclient/model/GameTimeToBeatResult$Companion { +} + public final class ru/pixnews/igdbclient/model/GameVersion : com/squareup/wire/Message { public static final field ADAPTER Lcom/squareup/wire/ProtoAdapter; public static final field Companion Lru/pixnews/igdbclient/model/GameVersion$Companion; @@ -5187,6 +5252,23 @@ public final class ru/pixnews/igdbclient/scheme/field/GameModeField : java/lang/ public static fun values ()[Lru/pixnews/igdbclient/scheme/field/GameModeField; } +public final class ru/pixnews/igdbclient/scheme/field/GameTimeToBeatField : java/lang/Enum, ru/pixnews/igdbclient/scheme/field/IgdbField { + public static final field CHECKSUM Lru/pixnews/igdbclient/scheme/field/GameTimeToBeatField; + public static final field COMPLETELY Lru/pixnews/igdbclient/scheme/field/GameTimeToBeatField; + public static final field COUNT Lru/pixnews/igdbclient/scheme/field/GameTimeToBeatField; + public static final field CREATED_AT Lru/pixnews/igdbclient/scheme/field/GameTimeToBeatField; + public static final field GAME_ID Lru/pixnews/igdbclient/scheme/field/GameTimeToBeatField; + public static final field HASTILY Lru/pixnews/igdbclient/scheme/field/GameTimeToBeatField; + public static final field ID Lru/pixnews/igdbclient/scheme/field/GameTimeToBeatField; + public static final field NORMALLY Lru/pixnews/igdbclient/scheme/field/GameTimeToBeatField; + public static final field UPDATED_AT Lru/pixnews/igdbclient/scheme/field/GameTimeToBeatField; + public static fun getEntries ()Lkotlin/enums/EnumEntries; + public fun getIgdbName ()Ljava/lang/String; + public fun toString ()Ljava/lang/String; + public static fun valueOf (Ljava/lang/String;)Lru/pixnews/igdbclient/scheme/field/GameTimeToBeatField; + public static fun values ()[Lru/pixnews/igdbclient/scheme/field/GameTimeToBeatField; +} + public final class ru/pixnews/igdbclient/scheme/field/GameVersionFeatureField : java/lang/Enum, ru/pixnews/igdbclient/scheme/field/IgdbField { public static final field CATEGORY Lru/pixnews/igdbclient/scheme/field/GameVersionFeatureField; public static final field CHECKSUM Lru/pixnews/igdbclient/scheme/field/GameVersionFeatureField; diff --git a/igdbclient-core/api/jvm/igdbclient-core.api b/igdbclient-core/api/jvm/igdbclient-core.api index 5929e6a..ff8cc86 100644 --- a/igdbclient-core/api/jvm/igdbclient-core.api +++ b/igdbclient-core/api/jvm/igdbclient-core.api @@ -32,6 +32,7 @@ public final class ru/pixnews/igdbclient/IgdbClientKt { public static final fun getGameEngines (Lru/pixnews/igdbclient/IgdbClient;Lkotlin/jvm/functions/Function1;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public static final fun getGameLocalizations (Lru/pixnews/igdbclient/IgdbClient;Lkotlin/jvm/functions/Function1;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public static final fun getGameModes (Lru/pixnews/igdbclient/IgdbClient;Lkotlin/jvm/functions/Function1;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static final fun getGameTimeToBeat (Lru/pixnews/igdbclient/IgdbClient;Lkotlin/jvm/functions/Function1;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public static final fun getGameVersionFeatureValues (Lru/pixnews/igdbclient/IgdbClient;Lkotlin/jvm/functions/Function1;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public static final fun getGameVersionFeatures (Lru/pixnews/igdbclient/IgdbClient;Lkotlin/jvm/functions/Function1;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public static final fun getGameVersions (Lru/pixnews/igdbclient/IgdbClient;Lkotlin/jvm/functions/Function1;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; @@ -115,6 +116,7 @@ public final class ru/pixnews/igdbclient/IgdbEndpoint$Companion { public final fun getGAME_ENGINE_LOGO ()Lru/pixnews/igdbclient/IgdbEndpoint; public final fun getGAME_LOCALIZATION ()Lru/pixnews/igdbclient/IgdbEndpoint; public final fun getGAME_MODE ()Lru/pixnews/igdbclient/IgdbEndpoint; + public final fun getGAME_TIME_TO_BEAT ()Lru/pixnews/igdbclient/IgdbEndpoint; public final fun getGAME_VERSION ()Lru/pixnews/igdbclient/IgdbEndpoint; public final fun getGAME_VERSION_FEATURE ()Lru/pixnews/igdbclient/IgdbEndpoint; public final fun getGAME_VERSION_FEATURE_VALUE ()Lru/pixnews/igdbclient/IgdbEndpoint; @@ -859,6 +861,23 @@ public final class ru/pixnews/igdbclient/dsl/field/GameModeFieldDslKt { public static final fun getField (Lru/pixnews/igdbclient/model/GameMode$Companion;)Lru/pixnews/igdbclient/dsl/field/GameModeFieldDsl; } +public final class ru/pixnews/igdbclient/dsl/field/GameTimeToBeatFieldDsl : ru/pixnews/igdbclient/dsl/field/IgdbRequestFieldDsl { + public fun ()V + public final fun getChecksum ()Lru/pixnews/igdbclient/dsl/field/IgdbRequestField; + public final fun getCompletely ()Lru/pixnews/igdbclient/dsl/field/IgdbRequestField; + public final fun getCount ()Lru/pixnews/igdbclient/dsl/field/IgdbRequestField; + public final fun getCreated_at ()Lru/pixnews/igdbclient/dsl/field/IgdbRequestField; + public final fun getGame_id ()Lru/pixnews/igdbclient/dsl/field/IgdbRequestField; + public final fun getHastily ()Lru/pixnews/igdbclient/dsl/field/IgdbRequestField; + public final fun getId ()Lru/pixnews/igdbclient/dsl/field/IgdbRequestField; + public final fun getNormally ()Lru/pixnews/igdbclient/dsl/field/IgdbRequestField; + public final fun getUpdated_at ()Lru/pixnews/igdbclient/dsl/field/IgdbRequestField; +} + +public final class ru/pixnews/igdbclient/dsl/field/GameTimeToBeatFieldDslKt { + public static final fun getField (Lru/pixnews/igdbclient/model/GameTimeToBeat$Companion;)Lru/pixnews/igdbclient/dsl/field/GameTimeToBeatFieldDsl; +} + public final class ru/pixnews/igdbclient/dsl/field/GameVersionFeatureFieldDsl : ru/pixnews/igdbclient/dsl/field/IgdbRequestFieldDsl { public fun ()V public final fun getCategory ()Lru/pixnews/igdbclient/dsl/field/IgdbRequestField; @@ -3029,6 +3048,52 @@ public final class ru/pixnews/igdbclient/model/GameStatusEnum$Companion { public final fun fromValue (I)Lru/pixnews/igdbclient/model/GameStatusEnum; } +public final class ru/pixnews/igdbclient/model/GameTimeToBeat : com/squareup/wire/Message { + public static final field ADAPTER Lcom/squareup/wire/ProtoAdapter; + public static final field Companion Lru/pixnews/igdbclient/model/GameTimeToBeat$Companion; + public fun ()V + public fun (JIIIIILjava/time/Instant;Ljava/time/Instant;Ljava/lang/String;Lokio/ByteString;)V + public synthetic fun (JIIIIILjava/time/Instant;Ljava/time/Instant;Ljava/lang/String;Lokio/ByteString;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public final fun copy (JIIIIILjava/time/Instant;Ljava/time/Instant;Ljava/lang/String;Lokio/ByteString;)Lru/pixnews/igdbclient/model/GameTimeToBeat; + public static synthetic fun copy$default (Lru/pixnews/igdbclient/model/GameTimeToBeat;JIIIIILjava/time/Instant;Ljava/time/Instant;Ljava/lang/String;Lokio/ByteString;ILjava/lang/Object;)Lru/pixnews/igdbclient/model/GameTimeToBeat; + public fun equals (Ljava/lang/Object;)Z + public final fun getChecksum ()Ljava/lang/String; + public final fun getCompletely ()I + public final fun getCount ()I + public final fun getCreated_at ()Ljava/time/Instant; + public final fun getGame_id ()I + public final fun getHastily ()I + public final fun getId ()J + public final fun getNormally ()I + public final fun getUpdated_at ()Ljava/time/Instant; + public fun hashCode ()I + public synthetic fun newBuilder ()Lcom/squareup/wire/Message$Builder; + public synthetic fun newBuilder ()Ljava/lang/Void; + public fun toString ()Ljava/lang/String; +} + +public final class ru/pixnews/igdbclient/model/GameTimeToBeat$Companion { +} + +public final class ru/pixnews/igdbclient/model/GameTimeToBeatResult : com/squareup/wire/Message { + public static final field ADAPTER Lcom/squareup/wire/ProtoAdapter; + public static final field Companion Lru/pixnews/igdbclient/model/GameTimeToBeatResult$Companion; + public fun ()V + public fun (Ljava/util/List;Lokio/ByteString;)V + public synthetic fun (Ljava/util/List;Lokio/ByteString;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public final fun copy (Ljava/util/List;Lokio/ByteString;)Lru/pixnews/igdbclient/model/GameTimeToBeatResult; + public static synthetic fun copy$default (Lru/pixnews/igdbclient/model/GameTimeToBeatResult;Ljava/util/List;Lokio/ByteString;ILjava/lang/Object;)Lru/pixnews/igdbclient/model/GameTimeToBeatResult; + public fun equals (Ljava/lang/Object;)Z + public final fun getGametimetobeats ()Ljava/util/List; + public fun hashCode ()I + public synthetic fun newBuilder ()Lcom/squareup/wire/Message$Builder; + public synthetic fun newBuilder ()Ljava/lang/Void; + public fun toString ()Ljava/lang/String; +} + +public final class ru/pixnews/igdbclient/model/GameTimeToBeatResult$Companion { +} + public final class ru/pixnews/igdbclient/model/GameVersion : com/squareup/wire/Message { public static final field ADAPTER Lcom/squareup/wire/ProtoAdapter; public static final field Companion Lru/pixnews/igdbclient/model/GameVersion$Companion; @@ -5187,6 +5252,23 @@ public final class ru/pixnews/igdbclient/scheme/field/GameModeField : java/lang/ public static fun values ()[Lru/pixnews/igdbclient/scheme/field/GameModeField; } +public final class ru/pixnews/igdbclient/scheme/field/GameTimeToBeatField : java/lang/Enum, ru/pixnews/igdbclient/scheme/field/IgdbField { + public static final field CHECKSUM Lru/pixnews/igdbclient/scheme/field/GameTimeToBeatField; + public static final field COMPLETELY Lru/pixnews/igdbclient/scheme/field/GameTimeToBeatField; + public static final field COUNT Lru/pixnews/igdbclient/scheme/field/GameTimeToBeatField; + public static final field CREATED_AT Lru/pixnews/igdbclient/scheme/field/GameTimeToBeatField; + public static final field GAME_ID Lru/pixnews/igdbclient/scheme/field/GameTimeToBeatField; + public static final field HASTILY Lru/pixnews/igdbclient/scheme/field/GameTimeToBeatField; + public static final field ID Lru/pixnews/igdbclient/scheme/field/GameTimeToBeatField; + public static final field NORMALLY Lru/pixnews/igdbclient/scheme/field/GameTimeToBeatField; + public static final field UPDATED_AT Lru/pixnews/igdbclient/scheme/field/GameTimeToBeatField; + public static fun getEntries ()Lkotlin/enums/EnumEntries; + public fun getIgdbName ()Ljava/lang/String; + public fun toString ()Ljava/lang/String; + public static fun valueOf (Ljava/lang/String;)Lru/pixnews/igdbclient/scheme/field/GameTimeToBeatField; + public static fun values ()[Lru/pixnews/igdbclient/scheme/field/GameTimeToBeatField; +} + public final class ru/pixnews/igdbclient/scheme/field/GameVersionFeatureField : java/lang/Enum, ru/pixnews/igdbclient/scheme/field/IgdbField { public static final field CATEGORY Lru/pixnews/igdbclient/scheme/field/GameVersionFeatureField; public static final field CHECKSUM Lru/pixnews/igdbclient/scheme/field/GameVersionFeatureField; diff --git a/igdbclient-core/src/commonMain/kotlin/IgdbClient.kt b/igdbclient-core/src/commonMain/kotlin/IgdbClient.kt index 43f65a9..652154f 100644 --- a/igdbclient-core/src/commonMain/kotlin/IgdbClient.kt +++ b/igdbclient-core/src/commonMain/kotlin/IgdbClient.kt @@ -52,6 +52,7 @@ import ru.pixnews.igdbclient.model.GameEngineResult import ru.pixnews.igdbclient.model.GameLocalizationResult import ru.pixnews.igdbclient.model.GameModeResult import ru.pixnews.igdbclient.model.GameResult +import ru.pixnews.igdbclient.model.GameTimeToBeatResult import ru.pixnews.igdbclient.model.GameVersionFeatureResult import ru.pixnews.igdbclient.model.GameVersionFeatureValueResult import ru.pixnews.igdbclient.model.GameVersionResult @@ -293,6 +294,12 @@ public suspend fun IgdbClient.getGameLocalizations(builder: ApicalypseQueryBuild public suspend fun IgdbClient.getGameModes(builder: ApicalypseQueryBuilder.() -> Unit): GameModeResult = executeOrThrow(IgdbEndpoint.GAME_MODE, apicalypseQuery(builder)) +/** + * Average time to beat times for a game + */ +public suspend fun IgdbClient.getGameTimeToBeat(builder: ApicalypseQueryBuilder.() -> Unit): GameTimeToBeatResult = + executeOrThrow(IgdbEndpoint.GAME_TIME_TO_BEAT, apicalypseQuery(builder)) + /** * Details about game editions and versions */ diff --git a/igdbclient-core/src/commonMain/kotlin/IgdbEndpoint.kt b/igdbclient-core/src/commonMain/kotlin/IgdbEndpoint.kt index c051724..407d9fa 100644 --- a/igdbclient-core/src/commonMain/kotlin/IgdbEndpoint.kt +++ b/igdbclient-core/src/commonMain/kotlin/IgdbEndpoint.kt @@ -61,6 +61,8 @@ import ru.pixnews.igdbclient.model.GameLocalizationResult import ru.pixnews.igdbclient.model.GameMode import ru.pixnews.igdbclient.model.GameModeResult import ru.pixnews.igdbclient.model.GameResult +import ru.pixnews.igdbclient.model.GameTimeToBeat +import ru.pixnews.igdbclient.model.GameTimeToBeatResult import ru.pixnews.igdbclient.model.GameVersion import ru.pixnews.igdbclient.model.GameVersionFeature import ru.pixnews.igdbclient.model.GameVersionFeatureResult @@ -379,6 +381,15 @@ public open class IgdbEndpoint( GameMode.ADAPTER::decode, ) + /** + * Average time to beat times for a game + */ + public val GAME_TIME_TO_BEAT: IgdbEndpoint = IgdbEndpoint( + "game_time_to_beats", + GameTimeToBeatResult.ADAPTER::decode, + GameTimeToBeat.ADAPTER::decode, + ) + /** * Details about game editions and versions */ diff --git a/igdbclient-core/src/commonMain/kotlin/apicalypse/ApicalypseQueryBuilder.kt b/igdbclient-core/src/commonMain/kotlin/apicalypse/ApicalypseQueryBuilder.kt index ffd6afa..659a459 100644 --- a/igdbclient-core/src/commonMain/kotlin/apicalypse/ApicalypseQueryBuilder.kt +++ b/igdbclient-core/src/commonMain/kotlin/apicalypse/ApicalypseQueryBuilder.kt @@ -43,7 +43,7 @@ public class ApicalypseQueryBuilder { * Use [Game.field][ru.pixnews.igdbclient.model.Game.Companion.field] extension function to start building a * field request for the Game object. * - * For example, you can use `Game.Companion.field.all` to query all fields + * For example, you can use `Game.field.all` to query all fields * * See [https://api-docs.igdb.com/#fields](https://api-docs.igdb.com/#fields) */ diff --git a/igdbclient-core/src/commonMain/proto/igdbapi.proto b/igdbclient-core/src/commonMain/proto/igdbapi.proto index 3169e16..3fe1c1b 100644 --- a/igdbclient-core/src/commonMain/proto/igdbapi.proto +++ b/igdbclient-core/src/commonMain/proto/igdbapi.proto @@ -602,7 +602,7 @@ message Game { repeated Artwork artworks = 6; repeated Game bundles = 7; GameCategoryEnum category = 8; - Collection collection = 9; + Collection collection = 9 [deprecated = true]; Cover cover = 10; google.protobuf.Timestamp created_at = 11; repeated Game dlcs = 12; @@ -747,6 +747,22 @@ message GameMode { string checksum = 7; } +message GameTimeToBeatResult { + repeated GameTimeToBeat gametimetobeats = 1; +} + +message GameTimeToBeat { + uint64 id = 1; + int32 game_id = 2; + int32 hastily = 3; + int32 normally = 4; + int32 completely = 5; + int32 count = 6; + google.protobuf.Timestamp created_at = 7; + google.protobuf.Timestamp updated_at = 8; + string checksum = 9; +} + message GameVersionResult { repeated GameVersion gameversions = 1; } diff --git a/igdbclient-ktor/src/jvmTest/kotlin/RealKtorNetworkTestClient.kt b/igdbclient-ktor/src/jvmTest/kotlin/RealKtorNetworkTestClient.kt index 09adaad..b184d5c 100644 --- a/igdbclient-ktor/src/jvmTest/kotlin/RealKtorNetworkTestClient.kt +++ b/igdbclient-ktor/src/jvmTest/kotlin/RealKtorNetworkTestClient.kt @@ -32,6 +32,7 @@ import ru.pixnews.igdbclient.getCollectionTypes import ru.pixnews.igdbclient.getEventLogos import ru.pixnews.igdbclient.getEventNetworks import ru.pixnews.igdbclient.getEvents +import ru.pixnews.igdbclient.getGameTimeToBeat import ru.pixnews.igdbclient.getGames import ru.pixnews.igdbclient.getNetworkTypes import ru.pixnews.igdbclient.getPopularityPrimitives @@ -240,6 +241,15 @@ class RealKtorNetworkTestClient { logger.i { "popularity types: $popularityTypes" } } + @Test + fun testGameTimeToBeat() = runBlocking { + val timeToBeat = client.getGameTimeToBeat { + fields("*") + where("${PopularityPrimitiveField.GAME_ID} = 133236") + } + logger.i { "timeToBeat: $timeToBeat" } + } + class TestTokenProperties( val clientId: String?, val clientSecret: String?,