Skip to content

Commit

Permalink
Automated DCL import.
Browse files Browse the repository at this point in the history
  - 2468fcb1cb2f590a352f97f71175e4892cb15344 Automatic import from cloud_mmv2_dcl_20240724_1531_RC00 by DCL Team <no-reply@google.com>

GitOrigin-RevId: 2468fcb1cb2f590a352f97f71175e4892cb15344
  • Loading branch information
DCL Team authored and copybara-github committed Jul 24, 2024
1 parent a983c29 commit 8f7b5af
Show file tree
Hide file tree
Showing 33 changed files with 815 additions and 9 deletions.
8 changes: 8 additions & 0 deletions python/proto/gkehub/alpha/feature_membership.proto
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,13 @@ enum GkehubAlphaFeatureMembershipConfigmanagementPolicyControllerMonitoringBacke
GkehubAlphaFeatureMembershipConfigmanagementPolicyControllerMonitoringBackendsEnumCLOUD_MONITORING = 3;
}

enum GkehubAlphaFeatureMembershipConfigmanagementManagementEnum {
GkehubAlphaFeatureMembershipConfigmanagementManagementEnumNO_VALUE_DO_NOT_USE = 0;
GkehubAlphaFeatureMembershipConfigmanagementManagementEnumMANAGEMENT_UNSPECIFIED = 1;
GkehubAlphaFeatureMembershipConfigmanagementManagementEnumMANAGEMENT_AUTOMATIC = 2;
GkehubAlphaFeatureMembershipConfigmanagementManagementEnumMANAGEMENT_MANUAL = 3;
}

enum GkehubAlphaFeatureMembershipPolicycontrollerPolicyControllerHubConfigInstallSpecEnum {
GkehubAlphaFeatureMembershipPolicycontrollerPolicyControllerHubConfigInstallSpecEnumNO_VALUE_DO_NOT_USE = 0;
GkehubAlphaFeatureMembershipPolicycontrollerPolicyControllerHubConfigInstallSpecEnumINSTALL_SPEC_UNSPECIFIED = 1;
Expand Down Expand Up @@ -94,6 +101,7 @@ message GkehubAlphaFeatureMembershipConfigmanagement {
GkehubAlphaFeatureMembershipConfigmanagementBinauthz binauthz = 3;
GkehubAlphaFeatureMembershipConfigmanagementHierarchyController hierarchy_controller = 4;
string version = 5;
GkehubAlphaFeatureMembershipConfigmanagementManagementEnum management = 6;
}

message GkehubAlphaFeatureMembershipConfigmanagementConfigSync {
Expand Down
8 changes: 8 additions & 0 deletions python/proto/gkehub/beta/feature_membership.proto
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,13 @@ enum GkehubBetaFeatureMembershipConfigmanagementPolicyControllerMonitoringBacken
GkehubBetaFeatureMembershipConfigmanagementPolicyControllerMonitoringBackendsEnumCLOUD_MONITORING = 3;
}

enum GkehubBetaFeatureMembershipConfigmanagementManagementEnum {
GkehubBetaFeatureMembershipConfigmanagementManagementEnumNO_VALUE_DO_NOT_USE = 0;
GkehubBetaFeatureMembershipConfigmanagementManagementEnumMANAGEMENT_UNSPECIFIED = 1;
GkehubBetaFeatureMembershipConfigmanagementManagementEnumMANAGEMENT_AUTOMATIC = 2;
GkehubBetaFeatureMembershipConfigmanagementManagementEnumMANAGEMENT_MANUAL = 3;
}

enum GkehubBetaFeatureMembershipPolicycontrollerPolicyControllerHubConfigInstallSpecEnum {
GkehubBetaFeatureMembershipPolicycontrollerPolicyControllerHubConfigInstallSpecEnumNO_VALUE_DO_NOT_USE = 0;
GkehubBetaFeatureMembershipPolicycontrollerPolicyControllerHubConfigInstallSpecEnumINSTALL_SPEC_UNSPECIFIED = 1;
Expand Down Expand Up @@ -94,6 +101,7 @@ message GkehubBetaFeatureMembershipConfigmanagement {
GkehubBetaFeatureMembershipConfigmanagementBinauthz binauthz = 3;
GkehubBetaFeatureMembershipConfigmanagementHierarchyController hierarchy_controller = 4;
string version = 5;
GkehubBetaFeatureMembershipConfigmanagementManagementEnum management = 6;
}

message GkehubBetaFeatureMembershipConfigmanagementConfigSync {
Expand Down
8 changes: 8 additions & 0 deletions python/proto/gkehub/feature_membership.proto
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,13 @@ enum GkehubFeatureMembershipConfigmanagementPolicyControllerMonitoringBackendsEn
GkehubFeatureMembershipConfigmanagementPolicyControllerMonitoringBackendsEnumCLOUD_MONITORING = 3;
}

enum GkehubFeatureMembershipConfigmanagementManagementEnum {
GkehubFeatureMembershipConfigmanagementManagementEnumNO_VALUE_DO_NOT_USE = 0;
GkehubFeatureMembershipConfigmanagementManagementEnumMANAGEMENT_UNSPECIFIED = 1;
GkehubFeatureMembershipConfigmanagementManagementEnumMANAGEMENT_AUTOMATIC = 2;
GkehubFeatureMembershipConfigmanagementManagementEnumMANAGEMENT_MANUAL = 3;
}

enum GkehubFeatureMembershipPolicycontrollerPolicyControllerHubConfigInstallSpecEnum {
GkehubFeatureMembershipPolicycontrollerPolicyControllerHubConfigInstallSpecEnumNO_VALUE_DO_NOT_USE = 0;
GkehubFeatureMembershipPolicycontrollerPolicyControllerHubConfigInstallSpecEnumINSTALL_SPEC_UNSPECIFIED = 1;
Expand Down Expand Up @@ -94,6 +101,7 @@ message GkehubFeatureMembershipConfigmanagement {
GkehubFeatureMembershipConfigmanagementBinauthz binauthz = 3;
GkehubFeatureMembershipConfigmanagementHierarchyController hierarchy_controller = 4;
string version = 5;
GkehubFeatureMembershipConfigmanagementManagementEnum management = 6;
}

message GkehubFeatureMembershipConfigmanagementConfigSync {
Expand Down
31 changes: 31 additions & 0 deletions python/services/gkehub/alpha/feature_membership.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,12 +244,14 @@ def __init__(
binauthz: dict = None,
hierarchy_controller: dict = None,
version: str = None,
management: str = None,
):
self.config_sync = config_sync
self.policy_controller = policy_controller
self.binauthz = binauthz
self.hierarchy_controller = hierarchy_controller
self.version = version
self.management = management

@classmethod
def to_proto(self, resource):
Expand Down Expand Up @@ -293,6 +295,12 @@ def to_proto(self, resource):
res.ClearField("hierarchy_controller")
if Primitive.to_proto(resource.version):
res.version = Primitive.to_proto(resource.version)
if FeatureMembershipConfigmanagementManagementEnum.to_proto(
resource.management
):
res.management = FeatureMembershipConfigmanagementManagementEnum.to_proto(
resource.management
)
return res

@classmethod
Expand All @@ -314,6 +322,9 @@ def from_proto(self, resource):
resource.hierarchy_controller
),
version=Primitive.from_proto(resource.version),
management=FeatureMembershipConfigmanagementManagementEnum.from_proto(
resource.management
),
)


Expand Down Expand Up @@ -1682,6 +1693,26 @@ def from_proto(self, resource):
]


class FeatureMembershipConfigmanagementManagementEnum(object):
@classmethod
def to_proto(self, resource):
if not resource:
return resource
return feature_membership_pb2.GkehubAlphaFeatureMembershipConfigmanagementManagementEnum.Value(
"GkehubAlphaFeatureMembershipConfigmanagementManagementEnum%s" % resource
)

@classmethod
def from_proto(self, resource):
if not resource:
return resource
return feature_membership_pb2.GkehubAlphaFeatureMembershipConfigmanagementManagementEnum.Name(
resource
)[
len("GkehubAlphaFeatureMembershipConfigmanagementManagementEnum") :
]


class FeatureMembershipPolicycontrollerPolicyControllerHubConfigInstallSpecEnum(object):
@classmethod
def to_proto(self, resource):
Expand Down
25 changes: 25 additions & 0 deletions python/services/gkehub/alpha/feature_membership_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,18 @@ func ProtoToGkehubAlphaFeatureMembershipConfigmanagementPolicyControllerMonitori
return nil
}

// ProtoToFeatureMembershipConfigmanagementManagementEnum converts a FeatureMembershipConfigmanagementManagementEnum enum from its proto representation.
func ProtoToGkehubAlphaFeatureMembershipConfigmanagementManagementEnum(e alphapb.GkehubAlphaFeatureMembershipConfigmanagementManagementEnum) *alpha.FeatureMembershipConfigmanagementManagementEnum {
if e == 0 {
return nil
}
if n, ok := alphapb.GkehubAlphaFeatureMembershipConfigmanagementManagementEnum_name[int32(e)]; ok {
e := alpha.FeatureMembershipConfigmanagementManagementEnum(n[len("GkehubAlphaFeatureMembershipConfigmanagementManagementEnum"):])
return &e
}
return nil
}

// ProtoToFeatureMembershipPolicycontrollerPolicyControllerHubConfigInstallSpecEnum converts a FeatureMembershipPolicycontrollerPolicyControllerHubConfigInstallSpecEnum enum from its proto representation.
func ProtoToGkehubAlphaFeatureMembershipPolicycontrollerPolicyControllerHubConfigInstallSpecEnum(e alphapb.GkehubAlphaFeatureMembershipPolicycontrollerPolicyControllerHubConfigInstallSpecEnum) *alpha.FeatureMembershipPolicycontrollerPolicyControllerHubConfigInstallSpecEnum {
if e == 0 {
Expand Down Expand Up @@ -131,6 +143,7 @@ func ProtoToGkehubAlphaFeatureMembershipConfigmanagement(p *alphapb.GkehubAlphaF
Binauthz: ProtoToGkehubAlphaFeatureMembershipConfigmanagementBinauthz(p.GetBinauthz()),
HierarchyController: ProtoToGkehubAlphaFeatureMembershipConfigmanagementHierarchyController(p.GetHierarchyController()),
Version: dcl.StringOrNil(p.GetVersion()),
Management: ProtoToGkehubAlphaFeatureMembershipConfigmanagementManagementEnum(p.GetManagement()),
}
return obj
}
Expand Down Expand Up @@ -433,6 +446,17 @@ func GkehubAlphaFeatureMembershipConfigmanagementPolicyControllerMonitoringBacke
return alphapb.GkehubAlphaFeatureMembershipConfigmanagementPolicyControllerMonitoringBackendsEnum(0)
}

// FeatureMembershipConfigmanagementManagementEnumToProto converts a FeatureMembershipConfigmanagementManagementEnum enum to its proto representation.
func GkehubAlphaFeatureMembershipConfigmanagementManagementEnumToProto(e *alpha.FeatureMembershipConfigmanagementManagementEnum) alphapb.GkehubAlphaFeatureMembershipConfigmanagementManagementEnum {
if e == nil {
return alphapb.GkehubAlphaFeatureMembershipConfigmanagementManagementEnum(0)
}
if v, ok := alphapb.GkehubAlphaFeatureMembershipConfigmanagementManagementEnum_value["FeatureMembershipConfigmanagementManagementEnum"+string(*e)]; ok {
return alphapb.GkehubAlphaFeatureMembershipConfigmanagementManagementEnum(v)
}
return alphapb.GkehubAlphaFeatureMembershipConfigmanagementManagementEnum(0)
}

// FeatureMembershipPolicycontrollerPolicyControllerHubConfigInstallSpecEnumToProto converts a FeatureMembershipPolicycontrollerPolicyControllerHubConfigInstallSpecEnum enum to its proto representation.
func GkehubAlphaFeatureMembershipPolicycontrollerPolicyControllerHubConfigInstallSpecEnumToProto(e *alpha.FeatureMembershipPolicycontrollerPolicyControllerHubConfigInstallSpecEnum) alphapb.GkehubAlphaFeatureMembershipPolicycontrollerPolicyControllerHubConfigInstallSpecEnum {
if e == nil {
Expand Down Expand Up @@ -499,6 +523,7 @@ func GkehubAlphaFeatureMembershipConfigmanagementToProto(o *alpha.FeatureMembers
p.SetBinauthz(GkehubAlphaFeatureMembershipConfigmanagementBinauthzToProto(o.Binauthz))
p.SetHierarchyController(GkehubAlphaFeatureMembershipConfigmanagementHierarchyControllerToProto(o.HierarchyController))
p.SetVersion(dcl.ValueOrEmptyString(o.Version))
p.SetManagement(GkehubAlphaFeatureMembershipConfigmanagementManagementEnumToProto(o.Management))
return p
}

Expand Down
31 changes: 31 additions & 0 deletions python/services/gkehub/beta/feature_membership.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,12 +244,14 @@ def __init__(
binauthz: dict = None,
hierarchy_controller: dict = None,
version: str = None,
management: str = None,
):
self.config_sync = config_sync
self.policy_controller = policy_controller
self.binauthz = binauthz
self.hierarchy_controller = hierarchy_controller
self.version = version
self.management = management

@classmethod
def to_proto(self, resource):
Expand Down Expand Up @@ -293,6 +295,12 @@ def to_proto(self, resource):
res.ClearField("hierarchy_controller")
if Primitive.to_proto(resource.version):
res.version = Primitive.to_proto(resource.version)
if FeatureMembershipConfigmanagementManagementEnum.to_proto(
resource.management
):
res.management = FeatureMembershipConfigmanagementManagementEnum.to_proto(
resource.management
)
return res

@classmethod
Expand All @@ -314,6 +322,9 @@ def from_proto(self, resource):
resource.hierarchy_controller
),
version=Primitive.from_proto(resource.version),
management=FeatureMembershipConfigmanagementManagementEnum.from_proto(
resource.management
),
)


Expand Down Expand Up @@ -1682,6 +1693,26 @@ def from_proto(self, resource):
]


class FeatureMembershipConfigmanagementManagementEnum(object):
@classmethod
def to_proto(self, resource):
if not resource:
return resource
return feature_membership_pb2.GkehubBetaFeatureMembershipConfigmanagementManagementEnum.Value(
"GkehubBetaFeatureMembershipConfigmanagementManagementEnum%s" % resource
)

@classmethod
def from_proto(self, resource):
if not resource:
return resource
return feature_membership_pb2.GkehubBetaFeatureMembershipConfigmanagementManagementEnum.Name(
resource
)[
len("GkehubBetaFeatureMembershipConfigmanagementManagementEnum") :
]


class FeatureMembershipPolicycontrollerPolicyControllerHubConfigInstallSpecEnum(object):
@classmethod
def to_proto(self, resource):
Expand Down
25 changes: 25 additions & 0 deletions python/services/gkehub/beta/feature_membership_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,18 @@ func ProtoToGkehubBetaFeatureMembershipConfigmanagementPolicyControllerMonitorin
return nil
}

// ProtoToFeatureMembershipConfigmanagementManagementEnum converts a FeatureMembershipConfigmanagementManagementEnum enum from its proto representation.
func ProtoToGkehubBetaFeatureMembershipConfigmanagementManagementEnum(e betapb.GkehubBetaFeatureMembershipConfigmanagementManagementEnum) *beta.FeatureMembershipConfigmanagementManagementEnum {
if e == 0 {
return nil
}
if n, ok := betapb.GkehubBetaFeatureMembershipConfigmanagementManagementEnum_name[int32(e)]; ok {
e := beta.FeatureMembershipConfigmanagementManagementEnum(n[len("GkehubBetaFeatureMembershipConfigmanagementManagementEnum"):])
return &e
}
return nil
}

// ProtoToFeatureMembershipPolicycontrollerPolicyControllerHubConfigInstallSpecEnum converts a FeatureMembershipPolicycontrollerPolicyControllerHubConfigInstallSpecEnum enum from its proto representation.
func ProtoToGkehubBetaFeatureMembershipPolicycontrollerPolicyControllerHubConfigInstallSpecEnum(e betapb.GkehubBetaFeatureMembershipPolicycontrollerPolicyControllerHubConfigInstallSpecEnum) *beta.FeatureMembershipPolicycontrollerPolicyControllerHubConfigInstallSpecEnum {
if e == 0 {
Expand Down Expand Up @@ -131,6 +143,7 @@ func ProtoToGkehubBetaFeatureMembershipConfigmanagement(p *betapb.GkehubBetaFeat
Binauthz: ProtoToGkehubBetaFeatureMembershipConfigmanagementBinauthz(p.GetBinauthz()),
HierarchyController: ProtoToGkehubBetaFeatureMembershipConfigmanagementHierarchyController(p.GetHierarchyController()),
Version: dcl.StringOrNil(p.GetVersion()),
Management: ProtoToGkehubBetaFeatureMembershipConfigmanagementManagementEnum(p.GetManagement()),
}
return obj
}
Expand Down Expand Up @@ -433,6 +446,17 @@ func GkehubBetaFeatureMembershipConfigmanagementPolicyControllerMonitoringBacken
return betapb.GkehubBetaFeatureMembershipConfigmanagementPolicyControllerMonitoringBackendsEnum(0)
}

// FeatureMembershipConfigmanagementManagementEnumToProto converts a FeatureMembershipConfigmanagementManagementEnum enum to its proto representation.
func GkehubBetaFeatureMembershipConfigmanagementManagementEnumToProto(e *beta.FeatureMembershipConfigmanagementManagementEnum) betapb.GkehubBetaFeatureMembershipConfigmanagementManagementEnum {
if e == nil {
return betapb.GkehubBetaFeatureMembershipConfigmanagementManagementEnum(0)
}
if v, ok := betapb.GkehubBetaFeatureMembershipConfigmanagementManagementEnum_value["FeatureMembershipConfigmanagementManagementEnum"+string(*e)]; ok {
return betapb.GkehubBetaFeatureMembershipConfigmanagementManagementEnum(v)
}
return betapb.GkehubBetaFeatureMembershipConfigmanagementManagementEnum(0)
}

// FeatureMembershipPolicycontrollerPolicyControllerHubConfigInstallSpecEnumToProto converts a FeatureMembershipPolicycontrollerPolicyControllerHubConfigInstallSpecEnum enum to its proto representation.
func GkehubBetaFeatureMembershipPolicycontrollerPolicyControllerHubConfigInstallSpecEnumToProto(e *beta.FeatureMembershipPolicycontrollerPolicyControllerHubConfigInstallSpecEnum) betapb.GkehubBetaFeatureMembershipPolicycontrollerPolicyControllerHubConfigInstallSpecEnum {
if e == nil {
Expand Down Expand Up @@ -499,6 +523,7 @@ func GkehubBetaFeatureMembershipConfigmanagementToProto(o *beta.FeatureMembershi
p.SetBinauthz(GkehubBetaFeatureMembershipConfigmanagementBinauthzToProto(o.Binauthz))
p.SetHierarchyController(GkehubBetaFeatureMembershipConfigmanagementHierarchyControllerToProto(o.HierarchyController))
p.SetVersion(dcl.ValueOrEmptyString(o.Version))
p.SetManagement(GkehubBetaFeatureMembershipConfigmanagementManagementEnumToProto(o.Management))
return p
}

Expand Down
31 changes: 31 additions & 0 deletions python/services/gkehub/feature_membership.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,12 +244,14 @@ def __init__(
binauthz: dict = None,
hierarchy_controller: dict = None,
version: str = None,
management: str = None,
):
self.config_sync = config_sync
self.policy_controller = policy_controller
self.binauthz = binauthz
self.hierarchy_controller = hierarchy_controller
self.version = version
self.management = management

@classmethod
def to_proto(self, resource):
Expand Down Expand Up @@ -293,6 +295,12 @@ def to_proto(self, resource):
res.ClearField("hierarchy_controller")
if Primitive.to_proto(resource.version):
res.version = Primitive.to_proto(resource.version)
if FeatureMembershipConfigmanagementManagementEnum.to_proto(
resource.management
):
res.management = FeatureMembershipConfigmanagementManagementEnum.to_proto(
resource.management
)
return res

@classmethod
Expand All @@ -314,6 +322,9 @@ def from_proto(self, resource):
resource.hierarchy_controller
),
version=Primitive.from_proto(resource.version),
management=FeatureMembershipConfigmanagementManagementEnum.from_proto(
resource.management
),
)


Expand Down Expand Up @@ -1672,6 +1683,26 @@ def from_proto(self, resource):
]


class FeatureMembershipConfigmanagementManagementEnum(object):
@classmethod
def to_proto(self, resource):
if not resource:
return resource
return feature_membership_pb2.GkehubFeatureMembershipConfigmanagementManagementEnum.Value(
"GkehubFeatureMembershipConfigmanagementManagementEnum%s" % resource
)

@classmethod
def from_proto(self, resource):
if not resource:
return resource
return feature_membership_pb2.GkehubFeatureMembershipConfigmanagementManagementEnum.Name(
resource
)[
len("GkehubFeatureMembershipConfigmanagementManagementEnum") :
]


class FeatureMembershipPolicycontrollerPolicyControllerHubConfigInstallSpecEnum(object):
@classmethod
def to_proto(self, resource):
Expand Down
Loading

0 comments on commit 8f7b5af

Please sign in to comment.