@@ -2900,6 +2900,159 @@ public static void OpenALootBoxForAssetInstances(int assetInstanceID, Action<Loo
2900
2900
LootLockerAPIManager . OpenALootBox ( data , onComplete ) ;
2901
2901
}
2902
2902
#endregion
2903
+
2904
+ #region AssetInstance progressions
2905
+
2906
+ /// <summary>
2907
+ /// Returns multiple progressions for an asset instance.
2908
+ /// </summary>
2909
+ /// <param name="assetInstanceId">ID of the asset instance</param>
2910
+ /// <param name="count">Amount of entries to receive</param>
2911
+ /// <param name="after">Used for pagination, ID of the asset instance progression from which the pagination starts from, use the next_cursor and previous_cursor values</param>
2912
+ /// <param name="onComplete">onComplete Action for handling the response of type LootLockerPaginatedAssetInstanceProgressions</param>
2913
+ public static void GetAssetInstanceProgressions ( int assetInstanceId , int count , string after , Action < LootLockerPaginatedAssetInstanceProgressionsResponse > onComplete )
2914
+ {
2915
+ if ( ! CheckInitialized ( ) )
2916
+ {
2917
+ onComplete ? . Invoke ( LootLockerResponseFactory . SDKNotInitializedError < LootLockerPaginatedAssetInstanceProgressionsResponse > ( ) ) ;
2918
+ return ;
2919
+ }
2920
+
2921
+ var endpoint = string . Format ( LootLockerEndPoints . getAllAssetInstanceProgressions . endPoint , assetInstanceId ) ;
2922
+
2923
+ endpoint += "?" ;
2924
+ if ( count > 0 )
2925
+ endpoint += $ "count={ count } &";
2926
+
2927
+ if ( ! string . IsNullOrEmpty ( after ) )
2928
+ endpoint += $ "after={ after } &";
2929
+
2930
+ LootLockerServerRequest . CallAPI ( endpoint , LootLockerHTTPMethod . GET , onComplete : ( serverResponse ) => { LootLockerResponse . Deserialize ( onComplete , serverResponse ) ; } ) ;
2931
+ }
2932
+
2933
+ /// <summary>
2934
+ /// Returns multiple progressions for an asset instance.
2935
+ /// </summary>
2936
+ /// <param name="assetInstanceId">ID of the asset instance</param>
2937
+ /// <param name="count">Amount of entries to receive</param>
2938
+ /// <param name="onComplete">onComplete Action for handling the response of type LootLockerPaginatedAssetInstanceProgressions</param>
2939
+ public static void GetAssetInstanceProgressions ( int assetInstanceId , int count , Action < LootLockerPaginatedAssetInstanceProgressionsResponse > onComplete )
2940
+ {
2941
+ GetAssetInstanceProgressions ( assetInstanceId , count , null , onComplete ) ;
2942
+ }
2943
+
2944
+ /// <summary>
2945
+ /// Returns multiple progressions for an asset instance.
2946
+ /// </summary>
2947
+ /// <param name="assetInstanceId">ID of the asset instance</param>
2948
+ /// <param name="onComplete">onComplete Action for handling the response of type LootLockerPaginatedAssetInstanceProgressions</param>
2949
+ public static void GetAssetInstanceProgressions ( int assetInstanceId , Action < LootLockerPaginatedAssetInstanceProgressionsResponse > onComplete )
2950
+ {
2951
+ GetAssetInstanceProgressions ( assetInstanceId , - 1 , null , onComplete ) ;
2952
+ }
2953
+
2954
+ /// <summary>
2955
+ /// Returns multiple progressions for an asset instance.
2956
+ /// </summary>
2957
+ /// <param name="assetInstanceId">ID of the asset instance</param>
2958
+ /// <param name="progressionKey">Progression key</param>
2959
+ /// <param name="onComplete">onComplete Action for handling the response of type LootLockerAssetInstanceProgression</param>
2960
+ public static void GetAssetInstanceProgression ( int assetInstanceId , string progressionKey , Action < LootLockerAssetInstanceProgressionResponse > onComplete )
2961
+ {
2962
+ if ( ! CheckInitialized ( ) )
2963
+ {
2964
+ onComplete ? . Invoke ( LootLockerResponseFactory . SDKNotInitializedError < LootLockerAssetInstanceProgressionResponse > ( ) ) ;
2965
+ return ;
2966
+ }
2967
+
2968
+ var endpoint = string . Format ( LootLockerEndPoints . getSingleAssetInstanceProgression . endPoint , assetInstanceId , progressionKey ) ;
2969
+
2970
+ LootLockerServerRequest . CallAPI ( endpoint , LootLockerHTTPMethod . GET , onComplete : ( serverResponse ) => { LootLockerResponse . Deserialize ( onComplete , serverResponse ) ; } ) ;
2971
+ }
2972
+
2973
+ /// <summary>
2974
+ /// Adds points to an asset instance progression.
2975
+ /// </summary>
2976
+ /// <param name="assetInstanceId">ID of the asset instance</param>
2977
+ /// <param name="progressionKey">Progression key</param>
2978
+ /// <param name="amount">Amount of points to add</param>
2979
+ /// <param name="onComplete">onComplete Action for handling the response of type LootLockerAssetInstanceProgressionWithRewards</param>
2980
+ public static void AddPointsToAssetInstanceProgression ( int assetInstanceId , string progressionKey , ulong amount , Action < LootLockerAssetInstanceProgressionWithRewardsResponse > onComplete )
2981
+ {
2982
+ if ( ! CheckInitialized ( ) )
2983
+ {
2984
+ onComplete ? . Invoke ( LootLockerResponseFactory . SDKNotInitializedError < LootLockerAssetInstanceProgressionWithRewardsResponse > ( ) ) ;
2985
+ return ;
2986
+ }
2987
+
2988
+ var endpoint = string . Format ( LootLockerEndPoints . addPointsToAssetInstanceProgression . endPoint , assetInstanceId , progressionKey ) ;
2989
+
2990
+ var body = LootLockerJson . SerializeObject ( new { amount } ) ;
2991
+
2992
+ LootLockerServerRequest . CallAPI ( endpoint , LootLockerHTTPMethod . POST , body , onComplete : ( serverResponse ) => { LootLockerResponse . Deserialize ( onComplete , serverResponse ) ; } ) ;
2993
+ }
2994
+
2995
+ /// <summary>
2996
+ /// Subtracts points from an asset instance progression.
2997
+ /// </summary>
2998
+ /// <param name="assetInstanceId">ID of the asset instance</param>
2999
+ /// <param name="progressionKey">Progression key</param>
3000
+ /// <param name="amount">Amount of points to subtract</param>
3001
+ /// <param name="onComplete">onComplete Action for handling the response of type LootLockerAssetInstanceProgressionWithRewards</param>
3002
+ public static void SubtractPointsFromAssetInstanceProgression ( int assetInstanceId , string progressionKey , ulong amount , Action < LootLockerAssetInstanceProgressionWithRewardsResponse > onComplete )
3003
+ {
3004
+ if ( ! CheckInitialized ( ) )
3005
+ {
3006
+ onComplete ? . Invoke ( LootLockerResponseFactory . SDKNotInitializedError < LootLockerAssetInstanceProgressionWithRewardsResponse > ( ) ) ;
3007
+ return ;
3008
+ }
3009
+
3010
+ var endpoint = string . Format ( LootLockerEndPoints . subtractPointsFromAssetInstanceProgression . endPoint , assetInstanceId , progressionKey ) ;
3011
+
3012
+ var body = LootLockerJson . SerializeObject ( new { amount } ) ;
3013
+
3014
+ LootLockerServerRequest . CallAPI ( endpoint , LootLockerHTTPMethod . POST , body , onComplete : ( serverResponse ) => { LootLockerResponse . Deserialize ( onComplete , serverResponse ) ; } ) ;
3015
+ }
3016
+
3017
+ /// <summary>
3018
+ /// Resets an asset instance progression.
3019
+ /// </summary>
3020
+ /// <param name="assetInstanceId">ID of the asset instance</param>
3021
+ /// <param name="progressionKey">Progression key</param>
3022
+ /// <param name="onComplete">onComplete Action for handling the response of type LootLockerAssetInstanceProgressionWithRewards</param>
3023
+ public static void ResetAssetInstanceProgression ( int assetInstanceId , string progressionKey , Action < LootLockerAssetInstanceProgressionWithRewardsResponse > onComplete )
3024
+ {
3025
+ if ( ! CheckInitialized ( ) )
3026
+ {
3027
+ onComplete ? . Invoke ( LootLockerResponseFactory . SDKNotInitializedError < LootLockerAssetInstanceProgressionWithRewardsResponse > ( ) ) ;
3028
+ return ;
3029
+ }
3030
+
3031
+ var endpoint = string . Format ( LootLockerEndPoints . resetAssetInstanceProgression . endPoint , assetInstanceId , progressionKey ) ;
3032
+
3033
+ LootLockerServerRequest . CallAPI ( endpoint , LootLockerHTTPMethod . POST , onComplete : ( serverResponse ) => { LootLockerResponse . Deserialize ( onComplete , serverResponse ) ; } ) ;
3034
+ }
3035
+
3036
+ /// <summary>
3037
+ /// Deletes an asset instance progression.
3038
+ /// </summary>
3039
+ /// <param name="assetInstanceId">ID of the asset instance</param>
3040
+ /// <param name="progressionKey">Progression key</param>
3041
+ /// <param name="onComplete">onComplete Action for handling the response of type LootLockerResponse</param>
3042
+ public static void DeleteAssetInstanceProgression ( int assetInstanceId , string progressionKey , Action < LootLockerResponse > onComplete )
3043
+ {
3044
+ if ( ! CheckInitialized ( ) )
3045
+ {
3046
+ onComplete ? . Invoke ( LootLockerResponseFactory . SDKNotInitializedError < LootLockerResponse > ( ) ) ;
3047
+ return ;
3048
+ }
3049
+
3050
+ var endpoint = string . Format ( LootLockerEndPoints . deleteAssetInstanceProgression . endPoint , assetInstanceId , progressionKey ) ;
3051
+
3052
+ LootLockerServerRequest . CallAPI ( endpoint , LootLockerHTTPMethod . DELETE , onComplete : ( serverResponse ) => { LootLockerResponse . Deserialize ( onComplete , serverResponse ) ; } ) ;
3053
+ }
3054
+
3055
+ #endregion
2903
3056
2904
3057
#region UserGeneratedContent
2905
3058
/// <summary>
0 commit comments