@@ -3,6 +3,11 @@ import { z } from "../../../framework";
3
3
import { FailedAPIOperationSchema , OkAPIOperationSchema } from "../../common" ;
4
4
5
5
import { ProjectIdSchema } from "../../projects/common" ;
6
+ import {
7
+ SiteLicenseQuotaSchema ,
8
+ SiteLicenseRunLimitSchema ,
9
+ SiteLicenseUptimeSchema ,
10
+ } from "../../licenses/common" ;
6
11
7
12
const LicenseRangeSchema = z
8
13
. array ( z . string ( ) )
@@ -48,71 +53,18 @@ export const ShoppingCartAddInputSchema = z
48
53
. nullish ( ) ,
49
54
description : z
50
55
. union ( [
51
- z
52
- . object ( {
53
- title : LicenseTitleSchema . optional ( ) ,
54
- description : LicenseDescriptionSchema . optional ( ) ,
55
- range : LicenseRangeSchema . optional ( ) ,
56
- period : z . enum ( [ "range" , "monthly" , "yearly" ] ) . describe (
57
- `Period for which this license is to be applied. If \`range\` is selected,
56
+ SiteLicenseQuotaSchema . extend ( {
57
+ title : LicenseTitleSchema . optional ( ) ,
58
+ description : LicenseDescriptionSchema . optional ( ) ,
59
+ range : LicenseRangeSchema . optional ( ) ,
60
+ period : z . enum ( [ "range" , "monthly" , "yearly" ] ) . describe (
61
+ `Period for which this license is to be applied. If \`range\` is selected,
58
62
the \`range\` field must be populated in this request.` ,
59
- ) ,
60
- type : z . enum ( [ "quota" ] ) . describe ( "License type" ) ,
61
- user : z . enum ( [ "academic" , "business" ] ) . describe ( "User type." ) ,
62
- run_limit : z
63
- . number ( )
64
- . min ( 0 )
65
- . describe (
66
- "Number of projects which may simultaneously use this license" ,
67
- ) ,
68
- always_running : z
69
- . boolean ( )
70
- . nullish ( )
71
- . describe (
72
- `Indicates whether the project(s) this license is applied to should be
73
- allowed to always be running.` ,
74
- ) ,
75
- ram : z
76
- . number ( )
77
- . min ( 1 )
78
- . describe (
79
- "Limits the total memory a project can use. At least 2GB is recommended." ,
80
- ) ,
81
- cpu : z
82
- . number ( )
83
- . min ( 1 )
84
- . describe (
85
- "Limits the total number of vCPUs allocated to a project." ,
86
- ) ,
87
- disk : z
88
- . number ( )
89
- . min ( 1 )
90
- . describe (
91
- `Disk size in GB to be allocated to the project to which this license is
92
- applied.` ,
93
- ) ,
94
- member : z . boolean ( ) . describe (
95
- `Member hosting significantly reduces competition for resources, and we
96
- prioritize support requests much higher. _Please be aware: licenses of
97
- different member hosting service levels cannot be combined!_` ,
98
- ) ,
99
- uptime : z
100
- . enum ( [ "short" , "medium" , "day" , "always_running" ] )
101
- . describe (
102
- `Determines how long a project runs while not being used before being
103
- automatically stopped. A \`short\` value corresponds to a 30-minute
104
- timeout, and a \`medium\` value to a 2-hour timeout.` ,
105
- ) ,
106
- boost : z
107
- . boolean ( )
108
- . nullish ( )
109
- . describe (
110
- `If \`true\`, this license is a boost license and allows for a project to
111
- temporarily boost the amount of resources available to a project by the
112
- amount specified in the \`cpu\`, \`memory\`, and \`disk\` fields.` ,
113
- ) ,
114
- } )
115
- . describe ( "Project resource quote license." ) ,
63
+ ) ,
64
+ type : z . enum ( [ "quota" ] ) . describe ( "License type" ) ,
65
+ run_limit : SiteLicenseRunLimitSchema ,
66
+ uptime : SiteLicenseUptimeSchema ,
67
+ } ) . describe ( "Project resource quota license." ) ,
116
68
z
117
69
. object ( {
118
70
title : LicenseTitleSchema ,
0 commit comments