Skip to content

Commit

Permalink
Automated DCL import.
Browse files Browse the repository at this point in the history
  - 4a81a27c56f42fd3070c507d632c3acc96ad5e53 Automatic import from cloud_mmv2_dcl_20240621_1831_RC00 by DCL Team <[email protected]>

GitOrigin-RevId: 4a81a27c56f42fd3070c507d632c3acc96ad5e53
  • Loading branch information
DCL Team authored and copybara-github committed Jun 22, 2024
1 parent bfd984d commit c3703a0
Show file tree
Hide file tree
Showing 31 changed files with 328 additions and 18 deletions.
7 changes: 4 additions & 3 deletions python/proto/gkehub/alpha/feature_membership.proto
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,10 @@ message GkehubAlphaFeatureMembershipConfigmanagement {
message GkehubAlphaFeatureMembershipConfigmanagementConfigSync {
GkehubAlphaFeatureMembershipConfigmanagementConfigSyncGit git = 1;
string source_format = 2;
bool prevent_drift = 3;
string metrics_gcp_service_account_email = 4;
GkehubAlphaFeatureMembershipConfigmanagementConfigSyncOci oci = 5;
bool enabled = 3;
bool prevent_drift = 4;
string metrics_gcp_service_account_email = 5;
GkehubAlphaFeatureMembershipConfigmanagementConfigSyncOci oci = 6;
}

message GkehubAlphaFeatureMembershipConfigmanagementConfigSyncGit {
Expand Down
7 changes: 4 additions & 3 deletions python/proto/gkehub/beta/feature_membership.proto
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,10 @@ message GkehubBetaFeatureMembershipConfigmanagement {
message GkehubBetaFeatureMembershipConfigmanagementConfigSync {
GkehubBetaFeatureMembershipConfigmanagementConfigSyncGit git = 1;
string source_format = 2;
bool prevent_drift = 3;
string metrics_gcp_service_account_email = 4;
GkehubBetaFeatureMembershipConfigmanagementConfigSyncOci oci = 5;
bool enabled = 3;
bool prevent_drift = 4;
string metrics_gcp_service_account_email = 5;
GkehubBetaFeatureMembershipConfigmanagementConfigSyncOci oci = 6;
}

message GkehubBetaFeatureMembershipConfigmanagementConfigSyncGit {
Expand Down
7 changes: 4 additions & 3 deletions python/proto/gkehub/feature_membership.proto
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,10 @@ message GkehubFeatureMembershipConfigmanagement {
message GkehubFeatureMembershipConfigmanagementConfigSync {
GkehubFeatureMembershipConfigmanagementConfigSyncGit git = 1;
string source_format = 2;
bool prevent_drift = 3;
string metrics_gcp_service_account_email = 4;
GkehubFeatureMembershipConfigmanagementConfigSyncOci oci = 5;
bool enabled = 3;
bool prevent_drift = 4;
string metrics_gcp_service_account_email = 5;
GkehubFeatureMembershipConfigmanagementConfigSyncOci oci = 6;
}

message GkehubFeatureMembershipConfigmanagementConfigSyncGit {
Expand Down
5 changes: 5 additions & 0 deletions python/services/gkehub/alpha/feature_membership.py
Original file line number Diff line number Diff line change
Expand Up @@ -335,12 +335,14 @@ def __init__(
self,
git: dict = None,
source_format: str = None,
enabled: bool = None,
prevent_drift: bool = None,
metrics_gcp_service_account_email: str = None,
oci: dict = None,
):
self.git = git
self.source_format = source_format
self.enabled = enabled
self.prevent_drift = prevent_drift
self.metrics_gcp_service_account_email = metrics_gcp_service_account_email
self.oci = oci
Expand All @@ -361,6 +363,8 @@ def to_proto(self, resource):
res.ClearField("git")
if Primitive.to_proto(resource.source_format):
res.source_format = Primitive.to_proto(resource.source_format)
if Primitive.to_proto(resource.enabled):
res.enabled = Primitive.to_proto(resource.enabled)
if Primitive.to_proto(resource.prevent_drift):
res.prevent_drift = Primitive.to_proto(resource.prevent_drift)
if Primitive.to_proto(resource.metrics_gcp_service_account_email):
Expand All @@ -383,6 +387,7 @@ def from_proto(self, resource):
return FeatureMembershipConfigmanagementConfigSync(
git=FeatureMembershipConfigmanagementConfigSyncGit.from_proto(resource.git),
source_format=Primitive.from_proto(resource.source_format),
enabled=Primitive.from_proto(resource.enabled),
prevent_drift=Primitive.from_proto(resource.prevent_drift),
metrics_gcp_service_account_email=Primitive.from_proto(
resource.metrics_gcp_service_account_email
Expand Down
2 changes: 2 additions & 0 deletions python/services/gkehub/alpha/feature_membership_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ func ProtoToGkehubAlphaFeatureMembershipConfigmanagementConfigSync(p *alphapb.Gk
obj := &alpha.FeatureMembershipConfigmanagementConfigSync{
Git: ProtoToGkehubAlphaFeatureMembershipConfigmanagementConfigSyncGit(p.GetGit()),
SourceFormat: dcl.StringOrNil(p.GetSourceFormat()),
Enabled: dcl.Bool(p.GetEnabled()),
PreventDrift: dcl.Bool(p.GetPreventDrift()),
MetricsGcpServiceAccountEmail: dcl.StringOrNil(p.GetMetricsGcpServiceAccountEmail()),
Oci: ProtoToGkehubAlphaFeatureMembershipConfigmanagementConfigSyncOci(p.GetOci()),
Expand Down Expand Up @@ -509,6 +510,7 @@ func GkehubAlphaFeatureMembershipConfigmanagementConfigSyncToProto(o *alpha.Feat
p := &alphapb.GkehubAlphaFeatureMembershipConfigmanagementConfigSync{}
p.SetGit(GkehubAlphaFeatureMembershipConfigmanagementConfigSyncGitToProto(o.Git))
p.SetSourceFormat(dcl.ValueOrEmptyString(o.SourceFormat))
p.SetEnabled(dcl.ValueOrEmptyBool(o.Enabled))
p.SetPreventDrift(dcl.ValueOrEmptyBool(o.PreventDrift))
p.SetMetricsGcpServiceAccountEmail(dcl.ValueOrEmptyString(o.MetricsGcpServiceAccountEmail))
p.SetOci(GkehubAlphaFeatureMembershipConfigmanagementConfigSyncOciToProto(o.Oci))
Expand Down
5 changes: 5 additions & 0 deletions python/services/gkehub/beta/feature_membership.py
Original file line number Diff line number Diff line change
Expand Up @@ -335,12 +335,14 @@ def __init__(
self,
git: dict = None,
source_format: str = None,
enabled: bool = None,
prevent_drift: bool = None,
metrics_gcp_service_account_email: str = None,
oci: dict = None,
):
self.git = git
self.source_format = source_format
self.enabled = enabled
self.prevent_drift = prevent_drift
self.metrics_gcp_service_account_email = metrics_gcp_service_account_email
self.oci = oci
Expand All @@ -361,6 +363,8 @@ def to_proto(self, resource):
res.ClearField("git")
if Primitive.to_proto(resource.source_format):
res.source_format = Primitive.to_proto(resource.source_format)
if Primitive.to_proto(resource.enabled):
res.enabled = Primitive.to_proto(resource.enabled)
if Primitive.to_proto(resource.prevent_drift):
res.prevent_drift = Primitive.to_proto(resource.prevent_drift)
if Primitive.to_proto(resource.metrics_gcp_service_account_email):
Expand All @@ -383,6 +387,7 @@ def from_proto(self, resource):
return FeatureMembershipConfigmanagementConfigSync(
git=FeatureMembershipConfigmanagementConfigSyncGit.from_proto(resource.git),
source_format=Primitive.from_proto(resource.source_format),
enabled=Primitive.from_proto(resource.enabled),
prevent_drift=Primitive.from_proto(resource.prevent_drift),
metrics_gcp_service_account_email=Primitive.from_proto(
resource.metrics_gcp_service_account_email
Expand Down
2 changes: 2 additions & 0 deletions python/services/gkehub/beta/feature_membership_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ func ProtoToGkehubBetaFeatureMembershipConfigmanagementConfigSync(p *betapb.Gkeh
obj := &beta.FeatureMembershipConfigmanagementConfigSync{
Git: ProtoToGkehubBetaFeatureMembershipConfigmanagementConfigSyncGit(p.GetGit()),
SourceFormat: dcl.StringOrNil(p.GetSourceFormat()),
Enabled: dcl.Bool(p.GetEnabled()),
PreventDrift: dcl.Bool(p.GetPreventDrift()),
MetricsGcpServiceAccountEmail: dcl.StringOrNil(p.GetMetricsGcpServiceAccountEmail()),
Oci: ProtoToGkehubBetaFeatureMembershipConfigmanagementConfigSyncOci(p.GetOci()),
Expand Down Expand Up @@ -509,6 +510,7 @@ func GkehubBetaFeatureMembershipConfigmanagementConfigSyncToProto(o *beta.Featur
p := &betapb.GkehubBetaFeatureMembershipConfigmanagementConfigSync{}
p.SetGit(GkehubBetaFeatureMembershipConfigmanagementConfigSyncGitToProto(o.Git))
p.SetSourceFormat(dcl.ValueOrEmptyString(o.SourceFormat))
p.SetEnabled(dcl.ValueOrEmptyBool(o.Enabled))
p.SetPreventDrift(dcl.ValueOrEmptyBool(o.PreventDrift))
p.SetMetricsGcpServiceAccountEmail(dcl.ValueOrEmptyString(o.MetricsGcpServiceAccountEmail))
p.SetOci(GkehubBetaFeatureMembershipConfigmanagementConfigSyncOciToProto(o.Oci))
Expand Down
5 changes: 5 additions & 0 deletions python/services/gkehub/feature_membership.py
Original file line number Diff line number Diff line change
Expand Up @@ -335,12 +335,14 @@ def __init__(
self,
git: dict = None,
source_format: str = None,
enabled: bool = None,
prevent_drift: bool = None,
metrics_gcp_service_account_email: str = None,
oci: dict = None,
):
self.git = git
self.source_format = source_format
self.enabled = enabled
self.prevent_drift = prevent_drift
self.metrics_gcp_service_account_email = metrics_gcp_service_account_email
self.oci = oci
Expand All @@ -359,6 +361,8 @@ def to_proto(self, resource):
res.ClearField("git")
if Primitive.to_proto(resource.source_format):
res.source_format = Primitive.to_proto(resource.source_format)
if Primitive.to_proto(resource.enabled):
res.enabled = Primitive.to_proto(resource.enabled)
if Primitive.to_proto(resource.prevent_drift):
res.prevent_drift = Primitive.to_proto(resource.prevent_drift)
if Primitive.to_proto(resource.metrics_gcp_service_account_email):
Expand All @@ -381,6 +385,7 @@ def from_proto(self, resource):
return FeatureMembershipConfigmanagementConfigSync(
git=FeatureMembershipConfigmanagementConfigSyncGit.from_proto(resource.git),
source_format=Primitive.from_proto(resource.source_format),
enabled=Primitive.from_proto(resource.enabled),
prevent_drift=Primitive.from_proto(resource.prevent_drift),
metrics_gcp_service_account_email=Primitive.from_proto(
resource.metrics_gcp_service_account_email
Expand Down
2 changes: 2 additions & 0 deletions python/services/gkehub/feature_membership_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ func ProtoToGkehubFeatureMembershipConfigmanagementConfigSync(p *gkehubpb.Gkehub
obj := &gkehub.FeatureMembershipConfigmanagementConfigSync{
Git: ProtoToGkehubFeatureMembershipConfigmanagementConfigSyncGit(p.GetGit()),
SourceFormat: dcl.StringOrNil(p.GetSourceFormat()),
Enabled: dcl.Bool(p.GetEnabled()),
PreventDrift: dcl.Bool(p.GetPreventDrift()),
MetricsGcpServiceAccountEmail: dcl.StringOrNil(p.GetMetricsGcpServiceAccountEmail()),
Oci: ProtoToGkehubFeatureMembershipConfigmanagementConfigSyncOci(p.GetOci()),
Expand Down Expand Up @@ -509,6 +510,7 @@ func GkehubFeatureMembershipConfigmanagementConfigSyncToProto(o *gkehub.FeatureM
p := &gkehubpb.GkehubFeatureMembershipConfigmanagementConfigSync{}
p.SetGit(GkehubFeatureMembershipConfigmanagementConfigSyncGitToProto(o.Git))
p.SetSourceFormat(dcl.ValueOrEmptyString(o.SourceFormat))
p.SetEnabled(dcl.ValueOrEmptyBool(o.Enabled))
p.SetPreventDrift(dcl.ValueOrEmptyBool(o.PreventDrift))
p.SetMetricsGcpServiceAccountEmail(dcl.ValueOrEmptyString(o.MetricsGcpServiceAccountEmail))
p.SetOci(GkehubFeatureMembershipConfigmanagementConfigSyncOciToProto(o.Oci))
Expand Down
3 changes: 3 additions & 0 deletions services/google/gkehub/alpha/feature_membership.go
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,7 @@ type FeatureMembershipConfigmanagementConfigSync struct {
empty bool `json:"-"`
Git *FeatureMembershipConfigmanagementConfigSyncGit `json:"git"`
SourceFormat *string `json:"sourceFormat"`
Enabled *bool `json:"enabled"`
PreventDrift *bool `json:"preventDrift"`
MetricsGcpServiceAccountEmail *string `json:"metricsGcpServiceAccountEmail"`
Oci *FeatureMembershipConfigmanagementConfigSyncOci `json:"oci"`
Expand All @@ -362,6 +363,8 @@ func (r *FeatureMembershipConfigmanagementConfigSync) UnmarshalJSON(data []byte)

r.SourceFormat = res.SourceFormat

r.Enabled = res.Enabled

r.PreventDrift = res.PreventDrift

r.MetricsGcpServiceAccountEmail = res.MetricsGcpServiceAccountEmail
Expand Down
9 changes: 9 additions & 0 deletions services/google/gkehub/alpha/feature_membership.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,15 @@ components:
description: Config Sync configuration for the cluster.
x-dcl-send-empty: true
properties:
enabled:
type: boolean
x-dcl-go-name: Enabled
description: Enables the installation of ConfigSync. If set to true,
ConfigSync resources will be created and the other ConfigSync
fields will be applied if exist. If set to false, all other ConfigSync
fields will be ignored, ConfigSync resources will be deleted.
If omitted, ConfigSync resources will be managed depends on the
presence of the git or oci field.
git:
type: object
x-dcl-go-name: Git
Expand Down

Large diffs are not rendered by default.

19 changes: 19 additions & 0 deletions services/google/gkehub/alpha/feature_membership_internal.go
Original file line number Diff line number Diff line change
Expand Up @@ -727,6 +727,11 @@ func canonicalizeFeatureMembershipConfigmanagementConfigSync(des, initial *Featu
} else {
cDes.SourceFormat = des.SourceFormat
}
if dcl.BoolCanonicalize(des.Enabled, initial.Enabled) || dcl.IsZeroValue(des.Enabled) {
cDes.Enabled = initial.Enabled
} else {
cDes.Enabled = des.Enabled
}
if dcl.BoolCanonicalize(des.PreventDrift, initial.PreventDrift) || dcl.IsZeroValue(des.PreventDrift) {
cDes.PreventDrift = initial.PreventDrift
} else {
Expand Down Expand Up @@ -789,6 +794,9 @@ func canonicalizeNewFeatureMembershipConfigmanagementConfigSync(c *Client, des,
if dcl.StringCanonicalize(des.SourceFormat, nw.SourceFormat) {
nw.SourceFormat = des.SourceFormat
}
if dcl.BoolCanonicalize(des.Enabled, nw.Enabled) {
nw.Enabled = des.Enabled
}
if dcl.BoolCanonicalize(des.PreventDrift, nw.PreventDrift) {
nw.PreventDrift = des.PreventDrift
}
Expand Down Expand Up @@ -3334,6 +3342,13 @@ func compareFeatureMembershipConfigmanagementConfigSyncNewStyle(d, a interface{}
diffs = append(diffs, ds...)
}

if ds, err := dcl.Diff(desired.Enabled, actual.Enabled, dcl.DiffInfo{OperationSelector: dcl.RequiresRecreate()}, fn.AddNest("Enabled")); len(ds) != 0 || err != nil {
if err != nil {
return nil, err
}
diffs = append(diffs, ds...)
}

if ds, err := dcl.Diff(desired.PreventDrift, actual.PreventDrift, dcl.DiffInfo{ServerDefault: true, OperationSelector: dcl.RequiresRecreate()}, fn.AddNest("PreventDrift")); len(ds) != 0 || err != nil {
if err != nil {
return nil, err
Expand Down Expand Up @@ -4614,6 +4629,9 @@ func expandFeatureMembershipConfigmanagementConfigSync(c *Client, f *FeatureMemb
if v := f.SourceFormat; !dcl.IsEmptyValueIndirect(v) {
m["sourceFormat"] = v
}
if v := f.Enabled; !dcl.IsEmptyValueIndirect(v) {
m["enabled"] = v
}
if v := f.PreventDrift; !dcl.IsEmptyValueIndirect(v) {
m["preventDrift"] = v
}
Expand Down Expand Up @@ -4644,6 +4662,7 @@ func flattenFeatureMembershipConfigmanagementConfigSync(c *Client, i interface{}
}
r.Git = flattenFeatureMembershipConfigmanagementConfigSyncGit(c, m["git"], res)
r.SourceFormat = dcl.FlattenString(m["sourceFormat"])
r.Enabled = dcl.FlattenBool(m["enabled"])
r.PreventDrift = dcl.FlattenBool(m["preventDrift"])
r.MetricsGcpServiceAccountEmail = dcl.FlattenString(m["metricsGcpServiceAccountEmail"])
r.Oci = flattenFeatureMembershipConfigmanagementConfigSyncOci(c, m["oci"], res)
Expand Down
5 changes: 5 additions & 0 deletions services/google/gkehub/alpha/feature_membership_schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,11 @@ func DCLFeatureMembershipSchema() *dcl.Schema {
Description: "Config Sync configuration for the cluster.",
SendEmpty: true,
Properties: map[string]*dcl.Property{
"enabled": &dcl.Property{
Type: "boolean",
GoName: "Enabled",
Description: "Enables the installation of ConfigSync. If set to true, ConfigSync resources will be created and the other ConfigSync fields will be applied if exist. If set to false, all other ConfigSync fields will be ignored, ConfigSync resources will be deleted. If omitted, ConfigSync resources will be managed depends on the presence of the git or oci field.",
},
"git": &dcl.Property{
Type: "object",
GoName: "Git",
Expand Down
3 changes: 3 additions & 0 deletions services/google/gkehub/beta/feature_membership.go
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,7 @@ type FeatureMembershipConfigmanagementConfigSync struct {
empty bool `json:"-"`
Git *FeatureMembershipConfigmanagementConfigSyncGit `json:"git"`
SourceFormat *string `json:"sourceFormat"`
Enabled *bool `json:"enabled"`
PreventDrift *bool `json:"preventDrift"`
MetricsGcpServiceAccountEmail *string `json:"metricsGcpServiceAccountEmail"`
Oci *FeatureMembershipConfigmanagementConfigSyncOci `json:"oci"`
Expand All @@ -362,6 +363,8 @@ func (r *FeatureMembershipConfigmanagementConfigSync) UnmarshalJSON(data []byte)

r.SourceFormat = res.SourceFormat

r.Enabled = res.Enabled

r.PreventDrift = res.PreventDrift

r.MetricsGcpServiceAccountEmail = res.MetricsGcpServiceAccountEmail
Expand Down
9 changes: 9 additions & 0 deletions services/google/gkehub/beta/feature_membership.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,15 @@ components:
description: Config Sync configuration for the cluster.
x-dcl-send-empty: true
properties:
enabled:
type: boolean
x-dcl-go-name: Enabled
description: Enables the installation of ConfigSync. If set to true,
ConfigSync resources will be created and the other ConfigSync
fields will be applied if exist. If set to false, all other ConfigSync
fields will be ignored, ConfigSync resources will be deleted.
If omitted, ConfigSync resources will be managed depends on the
presence of the git or oci field.
git:
type: object
x-dcl-go-name: Git
Expand Down

Large diffs are not rendered by default.

19 changes: 19 additions & 0 deletions services/google/gkehub/beta/feature_membership_internal.go
Original file line number Diff line number Diff line change
Expand Up @@ -727,6 +727,11 @@ func canonicalizeFeatureMembershipConfigmanagementConfigSync(des, initial *Featu
} else {
cDes.SourceFormat = des.SourceFormat
}
if dcl.BoolCanonicalize(des.Enabled, initial.Enabled) || dcl.IsZeroValue(des.Enabled) {
cDes.Enabled = initial.Enabled
} else {
cDes.Enabled = des.Enabled
}
if dcl.BoolCanonicalize(des.PreventDrift, initial.PreventDrift) || dcl.IsZeroValue(des.PreventDrift) {
cDes.PreventDrift = initial.PreventDrift
} else {
Expand Down Expand Up @@ -789,6 +794,9 @@ func canonicalizeNewFeatureMembershipConfigmanagementConfigSync(c *Client, des,
if dcl.StringCanonicalize(des.SourceFormat, nw.SourceFormat) {
nw.SourceFormat = des.SourceFormat
}
if dcl.BoolCanonicalize(des.Enabled, nw.Enabled) {
nw.Enabled = des.Enabled
}
if dcl.BoolCanonicalize(des.PreventDrift, nw.PreventDrift) {
nw.PreventDrift = des.PreventDrift
}
Expand Down Expand Up @@ -3334,6 +3342,13 @@ func compareFeatureMembershipConfigmanagementConfigSyncNewStyle(d, a interface{}
diffs = append(diffs, ds...)
}

if ds, err := dcl.Diff(desired.Enabled, actual.Enabled, dcl.DiffInfo{OperationSelector: dcl.RequiresRecreate()}, fn.AddNest("Enabled")); len(ds) != 0 || err != nil {
if err != nil {
return nil, err
}
diffs = append(diffs, ds...)
}

if ds, err := dcl.Diff(desired.PreventDrift, actual.PreventDrift, dcl.DiffInfo{ServerDefault: true, OperationSelector: dcl.RequiresRecreate()}, fn.AddNest("PreventDrift")); len(ds) != 0 || err != nil {
if err != nil {
return nil, err
Expand Down Expand Up @@ -4614,6 +4629,9 @@ func expandFeatureMembershipConfigmanagementConfigSync(c *Client, f *FeatureMemb
if v := f.SourceFormat; !dcl.IsEmptyValueIndirect(v) {
m["sourceFormat"] = v
}
if v := f.Enabled; !dcl.IsEmptyValueIndirect(v) {
m["enabled"] = v
}
if v := f.PreventDrift; !dcl.IsEmptyValueIndirect(v) {
m["preventDrift"] = v
}
Expand Down Expand Up @@ -4644,6 +4662,7 @@ func flattenFeatureMembershipConfigmanagementConfigSync(c *Client, i interface{}
}
r.Git = flattenFeatureMembershipConfigmanagementConfigSyncGit(c, m["git"], res)
r.SourceFormat = dcl.FlattenString(m["sourceFormat"])
r.Enabled = dcl.FlattenBool(m["enabled"])
r.PreventDrift = dcl.FlattenBool(m["preventDrift"])
r.MetricsGcpServiceAccountEmail = dcl.FlattenString(m["metricsGcpServiceAccountEmail"])
r.Oci = flattenFeatureMembershipConfigmanagementConfigSyncOci(c, m["oci"], res)
Expand Down
Loading

0 comments on commit c3703a0

Please sign in to comment.