Skip to content
This repository was archived by the owner on Dec 24, 2022. It is now read-only.

Commit db0e897

Browse files
committed
Add Aws product
1 parent bca706f commit db0e897

File tree

1 file changed

+23
-4
lines changed

1 file changed

+23
-4
lines changed

src/ServiceStack.Text/LicenseUtils.cs

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,19 @@ public enum LicenseType
2626
OrmLiteBusiness,
2727
RedisIndie,
2828
RedisBusiness,
29+
AwsIndie,
30+
AwsBusiness,
2931
Trial,
3032
}
3133

3234
[Flags]
3335
public enum LicenseFeature : long
3436
{
3537
None = 0,
36-
All = Premium | Text | Client | Common | Redis | OrmLite | ServiceStack | Server | Razor | Admin,
38+
All = Premium | Text | Client | Common | Redis | OrmLite | ServiceStack | Server | Razor | Admin | Aws,
3739
RedisSku = Redis | Text,
3840
OrmLiteSku = OrmLite | Text,
41+
AwsSku = Aws | Text,
3942
Free = None,
4043
Premium = 1 << 0,
4144
Text = 1 << 1,
@@ -47,6 +50,7 @@ public enum LicenseFeature : long
4750
Server = 1 << 7,
4851
Razor = 1 << 8,
4952
Admin = 1 << 9,
53+
Aws = 1 << 10,
5054
}
5155

5256
public enum QuotaType
@@ -55,7 +59,7 @@ public enum QuotaType
5559
Types, //Text, Redis
5660
Fields, //ServiceStack, Text, Redis, OrmLite
5761
RequestsPerHour, //Redis
58-
Tables, //OrmLite
62+
Tables, //OrmLite, Aws
5963
PremiumFeature, //AdminUI, Advanced Redis APIs, etc
6064
}
6165

@@ -125,6 +129,7 @@ public static class ErrorMessages
125129
internal const string ExceededRedisTypes = "The free-quota limit on '{0} Redis Types' has been reached." + UpgradeInstructions;
126130
internal const string ExceededRedisRequests = "The free-quota limit on '{0} Redis requests per hour' has been reached." + UpgradeInstructions;
127131
internal const string ExceededOrmLiteTables = "The free-quota limit on '{0} OrmLite Tables' has been reached." + UpgradeInstructions;
132+
internal const string ExceededAwsTables = "The free-quota limit on '{0} AWS Tables' has been reached." + UpgradeInstructions;
128133
internal const string ExceededServiceStackOperations = "The free-quota limit on '{0} ServiceStack Operations' has been reached." + UpgradeInstructions;
129134
internal const string ExceededAdminUi = "The Admin UI is a commerical-only premium feature." + UpgradeInstructions;
130135
internal const string ExceededPremiumFeature = "Unauthorized use of a commerical-only premium feature." + UpgradeInstructions;
@@ -139,6 +144,7 @@ public static class FreeQuotas
139144
public const int RedisTypes = 20;
140145
public const int RedisRequestPerHour = 6000;
141146
public const int OrmLiteTables = 10;
147+
public const int AwsTables = 10;
142148
public const int PremiumFeature = 0;
143149
}
144150

@@ -260,6 +266,15 @@ public static void AssertValidUsage(LicenseFeature feature, QuotaType quotaType,
260266
}
261267
break;
262268

269+
case LicenseFeature.Aws:
270+
switch (quotaType)
271+
{
272+
case QuotaType.Tables:
273+
ApprovedUsage(licensedFeatures, feature, FreeQuotas.AwsTables, count, ErrorMessages.ExceededAwsTables);
274+
return;
275+
}
276+
break;
277+
263278
case LicenseFeature.ServiceStack:
264279
switch (quotaType)
265280
{
@@ -307,11 +322,15 @@ public static LicenseFeature GetLicensedFeatures(this LicenseKey key)
307322
case LicenseType.TextIndie:
308323
case LicenseType.TextBusiness:
309324
return LicenseFeature.Text;
310-
325+
311326
case LicenseType.OrmLiteIndie:
312327
case LicenseType.OrmLiteBusiness:
313328
return LicenseFeature.OrmLiteSku;
314-
329+
330+
case LicenseType.AwsIndie:
331+
case LicenseType.AwsBusiness:
332+
return LicenseFeature.AwsSku;
333+
315334
case LicenseType.RedisIndie:
316335
case LicenseType.RedisBusiness:
317336
return LicenseFeature.RedisSku;

0 commit comments

Comments
 (0)