Add method to fetch grades from hebe

This commit is contained in:
Mikołaj Pich 2023-04-16 23:00:10 +02:00
parent 6b602b35d6
commit 51dd70067b
9 changed files with 555 additions and 10 deletions

View file

@ -4,10 +4,12 @@ public final class io/github/wulkanowy/sdk/hebe/Hebe {
public static synthetic fun addInterceptor$default (Lio/github/wulkanowy/sdk/hebe/Hebe;Lokhttp3/Interceptor;ZILjava/lang/Object;)V
public final fun getBaseUrl ()Ljava/lang/String;
public final fun getDeviceModel ()Ljava/lang/String;
public final fun getGrades (ILkotlin/coroutines/Continuation;)Ljava/lang/Object;
public final fun getKeyId ()Ljava/lang/String;
public final fun getLogLevel ()Lokhttp3/logging/HttpLoggingInterceptor$Level;
public final fun getPrivatePem ()Ljava/lang/String;
public final fun getSchoolSymbol ()Ljava/lang/String;
public final fun getPupilId ()I
public final fun getSchoolId ()Ljava/lang/String;
public final fun getStudents (Ljava/lang/String;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public final fun register (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public static synthetic fun register$default (Lio/github/wulkanowy/sdk/hebe/Hebe;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object;
@ -16,7 +18,8 @@ public final class io/github/wulkanowy/sdk/hebe/Hebe {
public final fun setKeyId (Ljava/lang/String;)V
public final fun setLogLevel (Lokhttp3/logging/HttpLoggingInterceptor$Level;)V
public final fun setPrivatePem (Ljava/lang/String;)V
public final fun setSchoolSymbol (Ljava/lang/String;)V
public final fun setPupilId (I)V
public final fun setSchoolId (Ljava/lang/String;)V
}
public final class io/github/wulkanowy/sdk/hebe/exception/InvalidPinException : java/io/IOException {
@ -35,6 +38,318 @@ public final class io/github/wulkanowy/sdk/hebe/exception/UnknownTokenException
public fun <init> (Ljava/lang/String;)V
}
public final class io/github/wulkanowy/sdk/hebe/models/Grade {
public static final field Companion Lio/github/wulkanowy/sdk/hebe/models/Grade$Companion;
public synthetic fun <init> (ILio/github/wulkanowy/sdk/hebe/models/Grade$Column;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Lio/github/wulkanowy/sdk/hebe/models/Grade$Creator;Lio/github/wulkanowy/sdk/hebe/models/Grade$DateCreated;Lio/github/wulkanowy/sdk/hebe/models/Grade$DateModify;ILjava/lang/String;Lio/github/wulkanowy/sdk/hebe/models/Grade$Modifier;ILjava/lang/Double;Lkotlinx/serialization/internal/SerializationConstructorMarker;)V
public fun <init> (Lio/github/wulkanowy/sdk/hebe/models/Grade$Column;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Lio/github/wulkanowy/sdk/hebe/models/Grade$Creator;Lio/github/wulkanowy/sdk/hebe/models/Grade$DateCreated;Lio/github/wulkanowy/sdk/hebe/models/Grade$DateModify;ILjava/lang/String;Lio/github/wulkanowy/sdk/hebe/models/Grade$Modifier;ILjava/lang/Double;)V
public synthetic fun <init> (Lio/github/wulkanowy/sdk/hebe/models/Grade$Column;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Lio/github/wulkanowy/sdk/hebe/models/Grade$Creator;Lio/github/wulkanowy/sdk/hebe/models/Grade$DateCreated;Lio/github/wulkanowy/sdk/hebe/models/Grade$DateModify;ILjava/lang/String;Lio/github/wulkanowy/sdk/hebe/models/Grade$Modifier;ILjava/lang/Double;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
public final fun component1 ()Lio/github/wulkanowy/sdk/hebe/models/Grade$Column;
public final fun component10 ()Lio/github/wulkanowy/sdk/hebe/models/Grade$Modifier;
public final fun component11 ()I
public final fun component12 ()Ljava/lang/Double;
public final fun component2 ()Ljava/lang/String;
public final fun component3 ()Ljava/lang/String;
public final fun component4 ()Ljava/lang/String;
public final fun component5 ()Lio/github/wulkanowy/sdk/hebe/models/Grade$Creator;
public final fun component6 ()Lio/github/wulkanowy/sdk/hebe/models/Grade$DateCreated;
public final fun component7 ()Lio/github/wulkanowy/sdk/hebe/models/Grade$DateModify;
public final fun component8 ()I
public final fun component9 ()Ljava/lang/String;
public final fun copy (Lio/github/wulkanowy/sdk/hebe/models/Grade$Column;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Lio/github/wulkanowy/sdk/hebe/models/Grade$Creator;Lio/github/wulkanowy/sdk/hebe/models/Grade$DateCreated;Lio/github/wulkanowy/sdk/hebe/models/Grade$DateModify;ILjava/lang/String;Lio/github/wulkanowy/sdk/hebe/models/Grade$Modifier;ILjava/lang/Double;)Lio/github/wulkanowy/sdk/hebe/models/Grade;
public static synthetic fun copy$default (Lio/github/wulkanowy/sdk/hebe/models/Grade;Lio/github/wulkanowy/sdk/hebe/models/Grade$Column;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Lio/github/wulkanowy/sdk/hebe/models/Grade$Creator;Lio/github/wulkanowy/sdk/hebe/models/Grade$DateCreated;Lio/github/wulkanowy/sdk/hebe/models/Grade$DateModify;ILjava/lang/String;Lio/github/wulkanowy/sdk/hebe/models/Grade$Modifier;ILjava/lang/Double;ILjava/lang/Object;)Lio/github/wulkanowy/sdk/hebe/models/Grade;
public fun equals (Ljava/lang/Object;)Z
public final fun getColumn ()Lio/github/wulkanowy/sdk/hebe/models/Grade$Column;
public final fun getComment ()Ljava/lang/String;
public final fun getContent ()Ljava/lang/String;
public final fun getContentRaw ()Ljava/lang/String;
public final fun getCreator ()Lio/github/wulkanowy/sdk/hebe/models/Grade$Creator;
public final fun getDateCreated ()Lio/github/wulkanowy/sdk/hebe/models/Grade$DateCreated;
public final fun getDateModify ()Lio/github/wulkanowy/sdk/hebe/models/Grade$DateModify;
public final fun getId ()I
public final fun getKey ()Ljava/lang/String;
public final fun getModifier ()Lio/github/wulkanowy/sdk/hebe/models/Grade$Modifier;
public final fun getPupilId ()I
public final fun getValue ()Ljava/lang/Double;
public fun hashCode ()I
public fun toString ()Ljava/lang/String;
public static final synthetic fun write$Self (Lio/github/wulkanowy/sdk/hebe/models/Grade;Lkotlinx/serialization/encoding/CompositeEncoder;Lkotlinx/serialization/descriptors/SerialDescriptor;)V
}
public final class io/github/wulkanowy/sdk/hebe/models/Grade$$serializer : kotlinx/serialization/internal/GeneratedSerializer {
public static final field INSTANCE Lio/github/wulkanowy/sdk/hebe/models/Grade$$serializer;
public fun childSerializers ()[Lkotlinx/serialization/KSerializer;
public fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Lio/github/wulkanowy/sdk/hebe/models/Grade;
public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object;
public fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor;
public fun serialize (Lkotlinx/serialization/encoding/Encoder;Lio/github/wulkanowy/sdk/hebe/models/Grade;)V
public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V
public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer;
}
public final class io/github/wulkanowy/sdk/hebe/models/Grade$Column {
public static final field Companion Lio/github/wulkanowy/sdk/hebe/models/Grade$Column$Companion;
public synthetic fun <init> (ILio/github/wulkanowy/sdk/hebe/models/Grade$Column$Category;Ljava/lang/String;ILjava/lang/String;ILjava/lang/String;Ljava/lang/String;IILio/github/wulkanowy/sdk/hebe/models/Grade$Column$Subject;DLkotlinx/serialization/internal/SerializationConstructorMarker;)V
public fun <init> (Lio/github/wulkanowy/sdk/hebe/models/Grade$Column$Category;Ljava/lang/String;ILjava/lang/String;ILjava/lang/String;Ljava/lang/String;IILio/github/wulkanowy/sdk/hebe/models/Grade$Column$Subject;D)V
public synthetic fun <init> (Lio/github/wulkanowy/sdk/hebe/models/Grade$Column$Category;Ljava/lang/String;ILjava/lang/String;ILjava/lang/String;Ljava/lang/String;IILio/github/wulkanowy/sdk/hebe/models/Grade$Column$Subject;DILkotlin/jvm/internal/DefaultConstructorMarker;)V
public final fun component1 ()Lio/github/wulkanowy/sdk/hebe/models/Grade$Column$Category;
public final fun component10 ()Lio/github/wulkanowy/sdk/hebe/models/Grade$Column$Subject;
public final fun component11 ()D
public final fun component2 ()Ljava/lang/String;
public final fun component3 ()I
public final fun component4 ()Ljava/lang/String;
public final fun component5 ()I
public final fun component6 ()Ljava/lang/String;
public final fun component7 ()Ljava/lang/String;
public final fun component8 ()I
public final fun component9 ()I
public final fun copy (Lio/github/wulkanowy/sdk/hebe/models/Grade$Column$Category;Ljava/lang/String;ILjava/lang/String;ILjava/lang/String;Ljava/lang/String;IILio/github/wulkanowy/sdk/hebe/models/Grade$Column$Subject;D)Lio/github/wulkanowy/sdk/hebe/models/Grade$Column;
public static synthetic fun copy$default (Lio/github/wulkanowy/sdk/hebe/models/Grade$Column;Lio/github/wulkanowy/sdk/hebe/models/Grade$Column$Category;Ljava/lang/String;ILjava/lang/String;ILjava/lang/String;Ljava/lang/String;IILio/github/wulkanowy/sdk/hebe/models/Grade$Column$Subject;DILjava/lang/Object;)Lio/github/wulkanowy/sdk/hebe/models/Grade$Column;
public fun equals (Ljava/lang/Object;)Z
public final fun getCategory ()Lio/github/wulkanowy/sdk/hebe/models/Grade$Column$Category;
public final fun getCode ()Ljava/lang/String;
public final fun getColor ()I
public final fun getGroup ()Ljava/lang/String;
public final fun getId ()I
public final fun getKey ()Ljava/lang/String;
public final fun getName ()Ljava/lang/String;
public final fun getNumber ()I
public final fun getPeriodId ()I
public final fun getSubject ()Lio/github/wulkanowy/sdk/hebe/models/Grade$Column$Subject;
public final fun getWeight ()D
public fun hashCode ()I
public fun toString ()Ljava/lang/String;
public static final synthetic fun write$Self (Lio/github/wulkanowy/sdk/hebe/models/Grade$Column;Lkotlinx/serialization/encoding/CompositeEncoder;Lkotlinx/serialization/descriptors/SerialDescriptor;)V
}
public final class io/github/wulkanowy/sdk/hebe/models/Grade$Column$$serializer : kotlinx/serialization/internal/GeneratedSerializer {
public static final field INSTANCE Lio/github/wulkanowy/sdk/hebe/models/Grade$Column$$serializer;
public fun childSerializers ()[Lkotlinx/serialization/KSerializer;
public fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Lio/github/wulkanowy/sdk/hebe/models/Grade$Column;
public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object;
public fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor;
public fun serialize (Lkotlinx/serialization/encoding/Encoder;Lio/github/wulkanowy/sdk/hebe/models/Grade$Column;)V
public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V
public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer;
}
public final class io/github/wulkanowy/sdk/hebe/models/Grade$Column$Category {
public static final field Companion Lio/github/wulkanowy/sdk/hebe/models/Grade$Column$Category$Companion;
public synthetic fun <init> (ILjava/lang/String;ILjava/lang/String;Lkotlinx/serialization/internal/SerializationConstructorMarker;)V
public fun <init> (Ljava/lang/String;ILjava/lang/String;)V
public final fun component1 ()Ljava/lang/String;
public final fun component2 ()I
public final fun component3 ()Ljava/lang/String;
public final fun copy (Ljava/lang/String;ILjava/lang/String;)Lio/github/wulkanowy/sdk/hebe/models/Grade$Column$Category;
public static synthetic fun copy$default (Lio/github/wulkanowy/sdk/hebe/models/Grade$Column$Category;Ljava/lang/String;ILjava/lang/String;ILjava/lang/Object;)Lio/github/wulkanowy/sdk/hebe/models/Grade$Column$Category;
public fun equals (Ljava/lang/Object;)Z
public final fun getCode ()Ljava/lang/String;
public final fun getId ()I
public final fun getName ()Ljava/lang/String;
public fun hashCode ()I
public fun toString ()Ljava/lang/String;
public static final synthetic fun write$Self (Lio/github/wulkanowy/sdk/hebe/models/Grade$Column$Category;Lkotlinx/serialization/encoding/CompositeEncoder;Lkotlinx/serialization/descriptors/SerialDescriptor;)V
}
public final class io/github/wulkanowy/sdk/hebe/models/Grade$Column$Category$$serializer : kotlinx/serialization/internal/GeneratedSerializer {
public static final field INSTANCE Lio/github/wulkanowy/sdk/hebe/models/Grade$Column$Category$$serializer;
public fun childSerializers ()[Lkotlinx/serialization/KSerializer;
public fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Lio/github/wulkanowy/sdk/hebe/models/Grade$Column$Category;
public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object;
public fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor;
public fun serialize (Lkotlinx/serialization/encoding/Encoder;Lio/github/wulkanowy/sdk/hebe/models/Grade$Column$Category;)V
public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V
public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer;
}
public final class io/github/wulkanowy/sdk/hebe/models/Grade$Column$Category$Companion {
public final fun serializer ()Lkotlinx/serialization/KSerializer;
}
public final class io/github/wulkanowy/sdk/hebe/models/Grade$Column$Companion {
public final fun serializer ()Lkotlinx/serialization/KSerializer;
}
public final class io/github/wulkanowy/sdk/hebe/models/Grade$Column$Subject {
public static final field Companion Lio/github/wulkanowy/sdk/hebe/models/Grade$Column$Subject$Companion;
public synthetic fun <init> (IILjava/lang/String;Ljava/lang/String;Ljava/lang/String;ILkotlinx/serialization/internal/SerializationConstructorMarker;)V
public fun <init> (ILjava/lang/String;Ljava/lang/String;Ljava/lang/String;I)V
public final fun component1 ()I
public final fun component2 ()Ljava/lang/String;
public final fun component3 ()Ljava/lang/String;
public final fun component4 ()Ljava/lang/String;
public final fun component5 ()I
public final fun copy (ILjava/lang/String;Ljava/lang/String;Ljava/lang/String;I)Lio/github/wulkanowy/sdk/hebe/models/Grade$Column$Subject;
public static synthetic fun copy$default (Lio/github/wulkanowy/sdk/hebe/models/Grade$Column$Subject;ILjava/lang/String;Ljava/lang/String;Ljava/lang/String;IILjava/lang/Object;)Lio/github/wulkanowy/sdk/hebe/models/Grade$Column$Subject;
public fun equals (Ljava/lang/Object;)Z
public final fun getId ()I
public final fun getKey ()Ljava/lang/String;
public final fun getKod ()Ljava/lang/String;
public final fun getName ()Ljava/lang/String;
public final fun getPosition ()I
public fun hashCode ()I
public fun toString ()Ljava/lang/String;
public static final synthetic fun write$Self (Lio/github/wulkanowy/sdk/hebe/models/Grade$Column$Subject;Lkotlinx/serialization/encoding/CompositeEncoder;Lkotlinx/serialization/descriptors/SerialDescriptor;)V
}
public final class io/github/wulkanowy/sdk/hebe/models/Grade$Column$Subject$$serializer : kotlinx/serialization/internal/GeneratedSerializer {
public static final field INSTANCE Lio/github/wulkanowy/sdk/hebe/models/Grade$Column$Subject$$serializer;
public fun childSerializers ()[Lkotlinx/serialization/KSerializer;
public fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Lio/github/wulkanowy/sdk/hebe/models/Grade$Column$Subject;
public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object;
public fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor;
public fun serialize (Lkotlinx/serialization/encoding/Encoder;Lio/github/wulkanowy/sdk/hebe/models/Grade$Column$Subject;)V
public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V
public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer;
}
public final class io/github/wulkanowy/sdk/hebe/models/Grade$Column$Subject$Companion {
public final fun serializer ()Lkotlinx/serialization/KSerializer;
}
public final class io/github/wulkanowy/sdk/hebe/models/Grade$Companion {
public final fun serializer ()Lkotlinx/serialization/KSerializer;
}
public final class io/github/wulkanowy/sdk/hebe/models/Grade$Creator {
public static final field Companion Lio/github/wulkanowy/sdk/hebe/models/Grade$Creator$Companion;
public synthetic fun <init> (ILjava/lang/String;ILjava/lang/String;Ljava/lang/String;Lkotlinx/serialization/internal/SerializationConstructorMarker;)V
public fun <init> (Ljava/lang/String;ILjava/lang/String;Ljava/lang/String;)V
public final fun component1 ()Ljava/lang/String;
public final fun component2 ()I
public final fun component3 ()Ljava/lang/String;
public final fun component4 ()Ljava/lang/String;
public final fun copy (Ljava/lang/String;ILjava/lang/String;Ljava/lang/String;)Lio/github/wulkanowy/sdk/hebe/models/Grade$Creator;
public static synthetic fun copy$default (Lio/github/wulkanowy/sdk/hebe/models/Grade$Creator;Ljava/lang/String;ILjava/lang/String;Ljava/lang/String;ILjava/lang/Object;)Lio/github/wulkanowy/sdk/hebe/models/Grade$Creator;
public fun equals (Ljava/lang/Object;)Z
public final fun getDisplayName ()Ljava/lang/String;
public final fun getId ()I
public final fun getName ()Ljava/lang/String;
public final fun getSurname ()Ljava/lang/String;
public fun hashCode ()I
public fun toString ()Ljava/lang/String;
public static final synthetic fun write$Self (Lio/github/wulkanowy/sdk/hebe/models/Grade$Creator;Lkotlinx/serialization/encoding/CompositeEncoder;Lkotlinx/serialization/descriptors/SerialDescriptor;)V
}
public final class io/github/wulkanowy/sdk/hebe/models/Grade$Creator$$serializer : kotlinx/serialization/internal/GeneratedSerializer {
public static final field INSTANCE Lio/github/wulkanowy/sdk/hebe/models/Grade$Creator$$serializer;
public fun childSerializers ()[Lkotlinx/serialization/KSerializer;
public fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Lio/github/wulkanowy/sdk/hebe/models/Grade$Creator;
public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object;
public fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor;
public fun serialize (Lkotlinx/serialization/encoding/Encoder;Lio/github/wulkanowy/sdk/hebe/models/Grade$Creator;)V
public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V
public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer;
}
public final class io/github/wulkanowy/sdk/hebe/models/Grade$Creator$Companion {
public final fun serializer ()Lkotlinx/serialization/KSerializer;
}
public final class io/github/wulkanowy/sdk/hebe/models/Grade$DateCreated {
public static final field Companion Lio/github/wulkanowy/sdk/hebe/models/Grade$DateCreated$Companion;
public synthetic fun <init> (ILjava/lang/String;Ljava/lang/String;Ljava/lang/String;JLkotlinx/serialization/internal/SerializationConstructorMarker;)V
public fun <init> (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;J)V
public final fun component1 ()Ljava/lang/String;
public final fun component2 ()Ljava/lang/String;
public final fun component3 ()Ljava/lang/String;
public final fun component4 ()J
public final fun copy (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;J)Lio/github/wulkanowy/sdk/hebe/models/Grade$DateCreated;
public static synthetic fun copy$default (Lio/github/wulkanowy/sdk/hebe/models/Grade$DateCreated;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;JILjava/lang/Object;)Lio/github/wulkanowy/sdk/hebe/models/Grade$DateCreated;
public fun equals (Ljava/lang/Object;)Z
public final fun getDate ()Ljava/lang/String;
public final fun getDateDisplay ()Ljava/lang/String;
public final fun getTime ()Ljava/lang/String;
public final fun getTimestamp ()J
public fun hashCode ()I
public fun toString ()Ljava/lang/String;
public static final synthetic fun write$Self (Lio/github/wulkanowy/sdk/hebe/models/Grade$DateCreated;Lkotlinx/serialization/encoding/CompositeEncoder;Lkotlinx/serialization/descriptors/SerialDescriptor;)V
}
public final class io/github/wulkanowy/sdk/hebe/models/Grade$DateCreated$$serializer : kotlinx/serialization/internal/GeneratedSerializer {
public static final field INSTANCE Lio/github/wulkanowy/sdk/hebe/models/Grade$DateCreated$$serializer;
public fun childSerializers ()[Lkotlinx/serialization/KSerializer;
public fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Lio/github/wulkanowy/sdk/hebe/models/Grade$DateCreated;
public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object;
public fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor;
public fun serialize (Lkotlinx/serialization/encoding/Encoder;Lio/github/wulkanowy/sdk/hebe/models/Grade$DateCreated;)V
public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V
public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer;
}
public final class io/github/wulkanowy/sdk/hebe/models/Grade$DateCreated$Companion {
public final fun serializer ()Lkotlinx/serialization/KSerializer;
}
public final class io/github/wulkanowy/sdk/hebe/models/Grade$DateModify {
public static final field Companion Lio/github/wulkanowy/sdk/hebe/models/Grade$DateModify$Companion;
public synthetic fun <init> (ILjava/lang/String;Ljava/lang/String;Ljava/lang/String;JLkotlinx/serialization/internal/SerializationConstructorMarker;)V
public fun <init> (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;J)V
public final fun component1 ()Ljava/lang/String;
public final fun component2 ()Ljava/lang/String;
public final fun component3 ()Ljava/lang/String;
public final fun component4 ()J
public final fun copy (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;J)Lio/github/wulkanowy/sdk/hebe/models/Grade$DateModify;
public static synthetic fun copy$default (Lio/github/wulkanowy/sdk/hebe/models/Grade$DateModify;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;JILjava/lang/Object;)Lio/github/wulkanowy/sdk/hebe/models/Grade$DateModify;
public fun equals (Ljava/lang/Object;)Z
public final fun getDate ()Ljava/lang/String;
public final fun getDateDisplay ()Ljava/lang/String;
public final fun getTime ()Ljava/lang/String;
public final fun getTimestamp ()J
public fun hashCode ()I
public fun toString ()Ljava/lang/String;
public static final synthetic fun write$Self (Lio/github/wulkanowy/sdk/hebe/models/Grade$DateModify;Lkotlinx/serialization/encoding/CompositeEncoder;Lkotlinx/serialization/descriptors/SerialDescriptor;)V
}
public final class io/github/wulkanowy/sdk/hebe/models/Grade$DateModify$$serializer : kotlinx/serialization/internal/GeneratedSerializer {
public static final field INSTANCE Lio/github/wulkanowy/sdk/hebe/models/Grade$DateModify$$serializer;
public fun childSerializers ()[Lkotlinx/serialization/KSerializer;
public fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Lio/github/wulkanowy/sdk/hebe/models/Grade$DateModify;
public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object;
public fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor;
public fun serialize (Lkotlinx/serialization/encoding/Encoder;Lio/github/wulkanowy/sdk/hebe/models/Grade$DateModify;)V
public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V
public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer;
}
public final class io/github/wulkanowy/sdk/hebe/models/Grade$DateModify$Companion {
public final fun serializer ()Lkotlinx/serialization/KSerializer;
}
public final class io/github/wulkanowy/sdk/hebe/models/Grade$Modifier {
public static final field Companion Lio/github/wulkanowy/sdk/hebe/models/Grade$Modifier$Companion;
public synthetic fun <init> (ILjava/lang/String;ILjava/lang/String;Ljava/lang/String;Lkotlinx/serialization/internal/SerializationConstructorMarker;)V
public fun <init> (Ljava/lang/String;ILjava/lang/String;Ljava/lang/String;)V
public final fun component1 ()Ljava/lang/String;
public final fun component2 ()I
public final fun component3 ()Ljava/lang/String;
public final fun component4 ()Ljava/lang/String;
public final fun copy (Ljava/lang/String;ILjava/lang/String;Ljava/lang/String;)Lio/github/wulkanowy/sdk/hebe/models/Grade$Modifier;
public static synthetic fun copy$default (Lio/github/wulkanowy/sdk/hebe/models/Grade$Modifier;Ljava/lang/String;ILjava/lang/String;Ljava/lang/String;ILjava/lang/Object;)Lio/github/wulkanowy/sdk/hebe/models/Grade$Modifier;
public fun equals (Ljava/lang/Object;)Z
public final fun getDisplayName ()Ljava/lang/String;
public final fun getId ()I
public final fun getName ()Ljava/lang/String;
public final fun getSurname ()Ljava/lang/String;
public fun hashCode ()I
public fun toString ()Ljava/lang/String;
public static final synthetic fun write$Self (Lio/github/wulkanowy/sdk/hebe/models/Grade$Modifier;Lkotlinx/serialization/encoding/CompositeEncoder;Lkotlinx/serialization/descriptors/SerialDescriptor;)V
}
public final class io/github/wulkanowy/sdk/hebe/models/Grade$Modifier$$serializer : kotlinx/serialization/internal/GeneratedSerializer {
public static final field INSTANCE Lio/github/wulkanowy/sdk/hebe/models/Grade$Modifier$$serializer;
public fun childSerializers ()[Lkotlinx/serialization/KSerializer;
public fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Lio/github/wulkanowy/sdk/hebe/models/Grade$Modifier;
public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object;
public fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor;
public fun serialize (Lkotlinx/serialization/encoding/Encoder;Lio/github/wulkanowy/sdk/hebe/models/Grade$Modifier;)V
public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V
public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer;
}
public final class io/github/wulkanowy/sdk/hebe/models/Grade$Modifier$Companion {
public final fun serializer ()Lkotlinx/serialization/KSerializer;
}
public final class io/github/wulkanowy/sdk/hebe/register/RegisterDevice {
public fun <init> (ILjava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V
public final fun component1 ()I

View file

@ -1,5 +1,6 @@
package io.github.wulkanowy.sdk.hebe
import io.github.wulkanowy.sdk.hebe.models.Grade
import io.github.wulkanowy.sdk.hebe.register.RegisterDevice
import io.github.wulkanowy.sdk.hebe.register.StudentInfo
import io.github.wulkanowy.sdk.hebe.repository.RepositoryManager
@ -35,12 +36,18 @@ class Hebe {
resettableManager.reset()
}
var schoolSymbol = ""
var schoolId = ""
set(value) {
field = value
resettableManager.reset()
}
var pupilId = -1
set(value) {
field = value
// resettableManager.reset() // todo: uncomment if some repo should be changed
}
var deviceModel = ""
set(value) {
field = value
@ -68,6 +75,13 @@ class Hebe {
private val routes by resettableLazy(resettableManager) { serviceManager.getRoutesRepository() }
private val studentRepository by resettableLazy(resettableManager) {
serviceManager.getStudentRepository(
baseUrl = baseUrl,
schoolId = schoolId,
)
}
suspend fun register(token: String, pin: String, symbol: String, firebaseToken: String? = null): RegisterDevice {
val (publicPem, privatePem, publicHash) = generateKeyPair()
@ -101,4 +115,11 @@ class Hebe {
.getRegisterRepository(url)
.getStudentInfo()
}
suspend fun getGrades(periodId: Int): List<Grade> {
return studentRepository.getGrades(
pupilId = pupilId,
periodId = periodId,
).orEmpty()
}
}

View file

@ -0,0 +1,134 @@
package io.github.wulkanowy.sdk.hebe.models
import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable
@Serializable
data class Grade(
@SerialName("Column")
val column: Column,
@SerialName("Comment")
val comment: String,
@SerialName("Content")
val content: String,
@SerialName("ContentRaw")
val contentRaw: String,
@SerialName("Creator")
val creator: Creator,
@SerialName("DateCreated")
val dateCreated: DateCreated,
@SerialName("DateModify")
val dateModify: DateModify,
// @SerialName("Denominator")
// val denominator: Any?,
@SerialName("Id")
val id: Int,
@SerialName("Key")
val key: String,
@SerialName("Modifier")
val modifier: Modifier,
// @SerialName("Numerator")
// val numerator: Any?,
@SerialName("PupilId")
val pupilId: Int,
@SerialName("Value")
val value: Double? = null,
) {
@Serializable
data class Column(
@SerialName("Category")
val category: Category? = null,
@SerialName("Code")
val code: String,
@SerialName("Color")
val color: Int,
@SerialName("Group")
val group: String? = null,
@SerialName("Id")
val id: Int,
@SerialName("Key")
val key: String,
@SerialName("Name")
val name: String,
@SerialName("Number")
val number: Int,
@SerialName("PeriodId")
val periodId: Int,
@SerialName("Subject")
val subject: Subject,
@SerialName("Weight")
val weight: Double,
) {
@Serializable
data class Category(
@SerialName("Code")
val code: String,
@SerialName("Id")
val id: Int,
@SerialName("Name")
val name: String,
)
@Serializable
data class Subject(
@SerialName("Id")
val id: Int,
@SerialName("Key")
val key: String,
@SerialName("Kod")
val kod: String,
@SerialName("Name")
val name: String,
@SerialName("Position")
val position: Int,
)
}
@Serializable
data class Creator(
@SerialName("DisplayName")
val displayName: String,
@SerialName("Id")
val id: Int,
@SerialName("Name")
val name: String,
@SerialName("Surname")
val surname: String,
)
@Serializable
data class DateCreated(
@SerialName("Date")
val date: String,
@SerialName("DateDisplay")
val dateDisplay: String,
@SerialName("Time")
val time: String,
@SerialName("Timestamp")
val timestamp: Long,
)
@Serializable
data class DateModify(
@SerialName("Date")
val date: String,
@SerialName("DateDisplay")
val dateDisplay: String,
@SerialName("Time")
val time: String,
@SerialName("Timestamp")
val timestamp: Long,
)
@Serializable
data class Modifier(
@SerialName("DisplayName")
val displayName: String,
@SerialName("Id")
val id: Int,
@SerialName("Name")
val name: String,
@SerialName("Surname")
val surname: String,
)
}

View file

@ -49,6 +49,13 @@ internal class RepositoryManager(
)
}
fun getStudentRepository(baseUrl: String, schoolId: String): StudentRepository = StudentRepository(
getRetrofitBuilder(isJson = true, signInterceptor = true)
.baseUrl("${baseUrl.removeSuffix("/")}/$schoolId/")
.build()
.create(),
)
internal fun getRegisterRepository(baseUrl: String, symbol: String = ""): RegisterRepository = getRegisterRepository(
baseUrl = "${baseUrl.removeSuffix("/")}/$symbol",
)

View file

@ -0,0 +1,14 @@
package io.github.wulkanowy.sdk.hebe.repository
import io.github.wulkanowy.sdk.hebe.models.Grade
import io.github.wulkanowy.sdk.hebe.service.StudentService
internal class StudentRepository(private val studentService: StudentService) {
suspend fun getGrades(pupilId: Int, periodId: Int): List<Grade>? {
return studentService.getGrades(
pupilId = pupilId,
periodId = periodId,
).envelope
}
}

View file

@ -0,0 +1,18 @@
package io.github.wulkanowy.sdk.hebe.service
import io.github.wulkanowy.sdk.hebe.ApiResponse
import io.github.wulkanowy.sdk.hebe.models.Grade
import retrofit2.http.GET
import retrofit2.http.Query
internal interface StudentService {
@GET("api/mobile/grade/byPupil")
suspend fun getGrades(
@Query("pupilId") pupilId: Int,
@Query("periodId") periodId: Int,
@Query("lastSyncDate") lastSyncDate: String = "1970-01-01 01:00:00",
@Query("lastId") lastId: Int = Int.MIN_VALUE,
@Query("pageSize") pageSize: Int = 500,
): ApiResponse<List<Grade>>
}

View file

@ -3,6 +3,7 @@ package io.github.wulkanowy.sdk.hebe
import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.test.runTest
import okhttp3.logging.HttpLoggingInterceptor
import org.junit.Assert.assertTrue
import org.junit.Before
import org.junit.Ignore
import org.junit.Test
@ -17,10 +18,11 @@ class HebeRemoteTest {
fun setUp() {
with(hebe) {
logLevel = HttpLoggingInterceptor.Level.BODY
keyId = ""
privatePem = ""
baseUrl = ""
schoolSymbol = ""
keyId = "///"
privatePem = "///"
baseUrl = "https://api.fakelog.cf/powiatwulkanowy/"
pupilId = 1234
schoolId = "008520"
deviceModel = "Pixel 4a (5G)"
}
}
@ -35,4 +37,11 @@ class HebeRemoteTest {
)
println(res)
}
@Test
fun `get grades`() = runTest {
val grades = hebe.getGrades(559)
assertTrue(grades.isNotEmpty())
println(grades[0])
}
}

View file

@ -138,7 +138,7 @@ class Sdk {
set(value) {
field = value
scrapper.schoolId = value
hebe.schoolSymbol = value
hebe.schoolId = value
}
var classId = 0
@ -370,8 +370,8 @@ class Sdk {
suspend fun getGrades(semesterId: Int): Grades = withContext(Dispatchers.IO) {
when (mode) {
Mode.HYBRID, Mode.SCRAPPER -> scrapper.getGrades(semesterId).mapGrades()
Mode.HEBE -> throw NotImplementedError("Not available in HEBE mode")
Mode.SCRAPPER -> scrapper.getGrades(semesterId).mapGrades()
Mode.HYBRID, Mode.HEBE -> hebe.getGrades(semesterId).mapGrades()
}
}

View file

@ -3,6 +3,9 @@ package io.github.wulkanowy.sdk.mapper
import io.github.wulkanowy.sdk.pojo.Grade
import io.github.wulkanowy.sdk.pojo.GradeSummary
import io.github.wulkanowy.sdk.pojo.Grades
import java.time.LocalDate
import java.time.format.DateTimeFormatter
import io.github.wulkanowy.sdk.hebe.models.Grade as HebeGrade
import io.github.wulkanowy.sdk.scrapper.grades.Grade as ScrapperGrade
import io.github.wulkanowy.sdk.scrapper.grades.GradeSummary as ScrapperGradeSummary
import io.github.wulkanowy.sdk.scrapper.grades.Grades as ScrapperGrades
@ -44,3 +47,27 @@ internal fun ScrapperGrades.mapGrades() = Grades(
isForAdults = isForAdults,
type = type,
)
internal fun List<HebeGrade>.mapGrades() = Grades(
details = map {
Grade(
subject = it.column.subject.name,
entry = it.content,
value = it.value ?: 0.0,
modifier = 0.0,
weight = it.column.weight.toString(),
weightValue = it.column.weight,
comment = it.comment,
symbol = it.column.code,
description = it.column.name,
color = it.column.color.toString(16).uppercase(),
teacher = "${it.creator.name} ${it.creator.surname}",
date = LocalDate.parse(it.dateCreated.date, DateTimeFormatter.ofPattern("yyyy.MM.dd")),
)
},
summary = listOf(),
isAverage = false,
isPoints = false,
isForAdults = false,
type = 0,
)