@@ -1370,13 +1370,26 @@ const (
13701370 DEVELOPMENT = InstanceType (btapb .Instance_DEVELOPMENT )
13711371)
13721372
1373+ // Edition is the edition of the instance.
1374+ type Edition int32
1375+
1376+ const (
1377+ // EditionUnspecified defaults to ENTERPRISE
1378+ EditionUnspecified Edition = Edition (btapb .Instance_EDITION_UNSPECIFIED )
1379+ // Enterprise edition is the default edition.
1380+ Enterprise Edition = Edition (btapb .Instance_ENTERPRISE )
1381+ // EnterprisePlus edition is the edition with higher limits and more features than Enterprise edition.
1382+ EnterprisePlus Edition = Edition (btapb .Instance_ENTERPRISE_PLUS )
1383+ )
1384+
13731385// InstanceInfo represents information about an instance
13741386type InstanceInfo struct {
13751387 Name string // name of the instance
13761388 DisplayName string // display name for UIs
13771389 InstanceState InstanceState
13781390 InstanceType InstanceType
13791391 Labels map [string ]string
1392+ Edition Edition
13801393}
13811394
13821395// InstanceConf contains the information necessary to create an Instance
@@ -1387,6 +1400,7 @@ type InstanceConf struct {
13871400 StorageType StorageType
13881401 InstanceType InstanceType
13891402 Labels map [string ]string
1403+ Edition Edition
13901404
13911405 // AutoscalingConfig configures the autoscaling properties on the cluster
13921406 // created with the instance. It is optional.
@@ -1409,6 +1423,7 @@ type InstanceWithClustersConfig struct {
14091423 Clusters []ClusterConfig
14101424 InstanceType InstanceType
14111425 Labels map [string ]string
1426+ Edition Edition
14121427 // Tags maps TagKey resource names (e.g., "tagKeys/123") to TagValue
14131428 // resource names (e.g., "tagValues/456") to be associated with the instance.
14141429 Tags map [string ]string
@@ -1426,6 +1441,7 @@ func (iac *InstanceAdminClient) CreateInstance(ctx context.Context, conf *Instan
14261441 InstanceType : conf .InstanceType ,
14271442 Labels : conf .Labels ,
14281443 Tags : conf .Tags ,
1444+ Edition : conf .Edition ,
14291445 Clusters : []ClusterConfig {
14301446 {
14311447 InstanceID : conf .InstanceId ,
@@ -1458,6 +1474,7 @@ func (iac *InstanceAdminClient) CreateInstanceWithClusters(ctx context.Context,
14581474 Type : btapb .Instance_Type (conf .InstanceType ),
14591475 Labels : conf .Labels ,
14601476 Tags : conf .Tags ,
1477+ Edition : btapb .Instance_Edition (conf .Edition ),
14611478 },
14621479 Clusters : clusters ,
14631480 }
@@ -1493,6 +1510,10 @@ func (iac *InstanceAdminClient) updateInstance(ctx context.Context, conf *Instan
14931510 ireq .Instance .Type = btapb .Instance_Type (conf .InstanceType )
14941511 mask .Paths = append (mask .Paths , "type" )
14951512 }
1513+ if conf .Edition != EditionUnspecified {
1514+ ireq .Instance .Edition = btapb .Instance_Edition (conf .Edition )
1515+ mask .Paths = append (mask .Paths , "edition" )
1516+ }
14961517 if conf .Labels != nil {
14971518 ireq .Instance .Labels = conf .Labels
14981519 mask .Paths = append (mask .Paths , "labels" )
@@ -1601,6 +1622,7 @@ func (iac *InstanceAdminClient) Instances(ctx context.Context) ([]*InstanceInfo,
16011622 InstanceState : InstanceState (i .State ),
16021623 InstanceType : InstanceType (i .Type ),
16031624 Labels : i .Labels ,
1625+ Edition : Edition (i .Edition ),
16041626 })
16051627 }
16061628 if len (res .FailedLocations ) > 0 {
@@ -1637,6 +1659,7 @@ func (iac *InstanceAdminClient) InstanceInfo(ctx context.Context, instanceID str
16371659 InstanceState : InstanceState (res .State ),
16381660 InstanceType : InstanceType (res .Type ),
16391661 Labels : res .Labels ,
1662+ Edition : Edition (res .Edition ),
16401663 }, nil
16411664}
16421665
0 commit comments